http://bugs.winehq.org/show_bug.cgi?id=20711
--- Comment #17 from Markus mst@collogia.de 2010-03-28 11:47:16 --- Hi Wylda,
at the moment I'm quite out of wine development (nothing made for half a year). But the only solution I see is to implement a pessimistic cleanup solution in compobj.c to fix an application bug. This would need something like this.
Create a new reference to the loaded (or maybe in between freed library). Create a new link to the DllCanUnloadNow function of it and call it afterwards. Additionally we must call a second FreeLibrary() in the same function.
static void apartment_freeunusedlibraries() ... HANDLE hLibrary; ... hLibrary = LoadLibraryExW(entry->dll->library_name, 0, LOAD_WITH_ALTERED_SEARCH_PATH); if (hLibrary) { entry->dll->DllCanUnloadNow = (void *)GetProcAddress(hLibrary, "DllCanUnloadNow"); } if (entry->dll->DllCanUnloadNow && (entry->dll->DllCanUnloadNow() == S_OK)) { ... else if (entry->unload_time) entry->unload_time = 0;
FreeLibrary(hLibrary); ...
This is only an idea. Maybe someone with deeper insight into compobj.c can give a statement if that can be a valid solution. In between you could have a test. A quick and dirty implementation and compilation fixed the error. But I made no other tests.
Best regards.