8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-23 18:43:03 +01:00

Shutdown attachments when fbembed is being unloaded.

This commit is contained in:
dimitr 2003-02-16 15:00:13 +00:00
parent d6a478f207
commit bfbb3613f0

View File

@ -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;
}