mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 04:43:03 +01:00
Fixed CORE-3632: Crash after calling fork in a process, using embedded firebird library
This commit is contained in:
parent
4c4e574fe2
commit
f641886ba3
@ -56,11 +56,14 @@ namespace
|
||||
// This helps initialize globals, needed before regular ctors run
|
||||
int initDone = 0;
|
||||
|
||||
void child(void)
|
||||
{
|
||||
// turn off dtors execution in forked process
|
||||
initDone = 2;
|
||||
}
|
||||
|
||||
void allClean()
|
||||
{
|
||||
#ifndef DARWIN // Somewhy cleanup code is called more than once on MAC
|
||||
fb_assert(initDone == 1);
|
||||
#endif
|
||||
if (initDone != 1)
|
||||
{
|
||||
return;
|
||||
@ -127,6 +130,7 @@ namespace
|
||||
#endif //DEBUG_INIT
|
||||
|
||||
initDone = 1;
|
||||
int ret = pthread_atfork(NULL, NULL, child);
|
||||
|
||||
Firebird::MemoryPool::contextPoolInit();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user