mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 19:23:03 +01:00
Shutdown attachments when fbembed is being unloaded.
This commit is contained in:
parent
d6a478f207
commit
bfbb3613f0
@ -49,14 +49,14 @@ BOOL WINAPI DllMain(HINSTANCE h, DWORD reason, LPVOID reserved)
|
||||
/* save instance value */
|
||||
hIBDLLInstance = h;
|
||||
|
||||
#ifdef GDS32
|
||||
char buffer[MAXPATHLEN], *p;
|
||||
int l;
|
||||
|
||||
switch (reason) {
|
||||
|
||||
case DLL_PROCESS_ATTACH:
|
||||
#ifdef GDS32
|
||||
{
|
||||
char buffer[MAXPATHLEN], *p;
|
||||
GetModuleFileName(hIBDLLInstance, buffer, sizeof(buffer));
|
||||
l = strlen(buffer);
|
||||
int l = strlen(buffer);
|
||||
p = buffer + l;
|
||||
while (l-- && *p-- != '\\');
|
||||
p++;
|
||||
@ -69,11 +69,19 @@ BOOL WINAPI DllMain(HINSTANCE h, DWORD reason, LPVOID reserved)
|
||||
hFBDLLInstance = LoadLibrary(FBDLLNAME);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case DLL_PROCESS_DETACH:
|
||||
FreeLibrary(hFBDLLInstance);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
|
||||
case DLL_PROCESS_DETACH:
|
||||
#ifdef GDS32
|
||||
FreeLibrary(hFBDLLInstance);
|
||||
#endif
|
||||
#ifdef EMBEDDED
|
||||
JRD_shutdown_all();
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user