Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-35267

Application crashes in the IEnumConnections->Next method after calling IConnectionPointContainer->Unadvise method

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P4: Low
    • 5.2.1
    • 5.1.1
    • ActiveX Support
    • None
    • Win32, VS2012
    • qtactiveqt: 0d29579baffd4f31a3ec39590117f4fee821694d (5.2.1, stable, 9.12.2013) Qt: 4: 3bef845f4623e0edcd52ddcffee3612f4f7f6779 (20.12.2013, 4.8.6)

    Description

      Application crashes in the IEnumConnections->Next method after calling IConnectionPointContainer->Unadvise method.It looks like enumerator getsinvalidated by subscription change.

      void crash4( IQTCrashPtr qtObject, TestSinkPtr sink )
      {
      	IConnectionPointPtr connectionPoint;
      	IConnectionPointContainerPtr( qtObject )->FindConnectionPoint( __uuidof( IQTCrashEvents ), &connectionPoint );
      
      	DWORD cookie1;
      	connectionPoint->Advise( sink, &cookie1 ); // first connection
      
      	DWORD cookie2;
      	connectionPoint->Advise( sink, &cookie2 ); // second connection
      
      	IEnumConnectionsPtr connections;
      	connectionPoint->EnumConnections( &connections );
      	connections->Reset(); // ->Next will crash without this
      
      	connectionPoint->Unadvise( cookie1 ); // disconnect the first connection
      
      	DWORD fetched;
      	CONNECTDATA cd = { 0, 0 };
      	while( connections->Next( 1, &cd, &fetched ) == S_OK ) // crash here
      	{
      	}
      }
      

      Example project that demonstrates the crash is attached

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            kleint Friedemann Kleint
            sbk Sergey Korepanov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes