ole32: Remove some dead code.

CoFreeUnusedLibraries doesn't do anything and COM_FlushMessageQueue 
won't actually allow any RPCs to be processed as the apartment has 
already been destroyed.
This commit is contained in:
Rob Shearman 2007-07-16 15:00:26 +01:00 committed by Alexandre Julliard
parent 0b33ef2685
commit d845022819

View file

@ -1056,31 +1056,6 @@ HRESULT WINAPI CoInitializeEx(LPVOID lpReserved, DWORD dwCoInit)
return hr;
}
/* On COM finalization for a STA thread, the message queue is flushed to ensure no
pending RPCs are ignored. Non-COM messages are discarded at this point.
*/
static void COM_FlushMessageQueue(void)
{
MSG message;
APARTMENT *apt = COM_CurrentApt();
if (!apt || !apt->win) return;
TRACE("Flushing STA message queue\n");
while (PeekMessageA(&message, NULL, 0, 0, PM_REMOVE))
{
if (message.hwnd != apt->win)
{
WARN("discarding message 0x%x for window %p\n", message.message, message.hwnd);
continue;
}
TranslateMessage(&message);
DispatchMessageA(&message);
}
}
/***********************************************************************
* CoUninitialize [OLE32.@]
*
@ -1131,12 +1106,6 @@ void WINAPI CoUninitialize(void)
TRACE("() - Releasing the COM libraries\n");
RunningObjectTableImpl_UnInitialize();
/* This will free the loaded COM Dlls */
CoFreeAllLibraries();
/* This ensures we deal with any pending RPCs */
COM_FlushMessageQueue();
}
else if (lCOMRefCnt<1) {
ERR( "CoUninitialize() - not CoInitialized.\n" );