winegstreamer: Prevent gstreamer from being unloaded.

oldstable
Maarten Lankhorst 2010-11-29 10:44:19 +01:00 committed by Alexandre Julliard
parent 2b01660178
commit e0169705d9
1 changed files with 9 additions and 0 deletions

View File

@ -261,6 +261,15 @@ DWORD Gstreamer_init(void) {
FIXME("Failed to initialize gstreamer: %s\n", err->message);
g_error_free(err);
}
if (inited) {
HINSTANCE newhandle;
/* Unloading glib is a bad idea.. it installs atexit handlers,
* so never unload the dll after loading */
GetModuleHandleExW(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS,
(LPCWSTR)hInst, &newhandle);
if (!newhandle)
ERR("Could not pin module %p\n", hInst);
}
}
return inited;
}