http://bugs.winehq.org/show_bug.cgi?id=32951
--- Comment #5 from Henri Verbeet hverbeet@gmail.com 2013-02-14 14:03:26 CST --- (In reply to comment #4)
Created attachment 43564 [details] hack to prevent the crash
Somehow the game detaches the ddraw.dll and tries to use the interface. Probably as long as some reference is left in the ddraw interface, we shouldn't detach the dll? A test might bring in some light. Could you try the attached patch?
Well, in theory we prevent unloading the dll with the GetModuleHandleExW() call a couple of lines above. Of course if the application just calls FreeLibrary() in a loop, or something silly like that it's not going to help, and on process exit everything is going to be unloaded anyway. Arguably we don't want to run the cleanup code in either of those cases, so we can probably just remove it. Still, it would probably be a good idea to verify that this isn't the result of some refcounting bug somewhere.