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

Revert "Make memory manager initialize before normal C++ global objects."

This reverts commit 4d28881a6c.

Not working in MacOS.
This commit is contained in:
Adriano dos Santos Fernandes 2021-09-13 13:58:01 -03:00
parent 65a0459123
commit c872f3cba0
2 changed files with 9 additions and 19 deletions

View File

@ -45,13 +45,6 @@
// operator in destructor will cause AV.
#undef DEBUG_INIT
#ifdef WIN_NT
#pragma init_seg(lib)
#define FB_INIT_PRIORITY
#else
#define FB_INIT_PRIORITY __attribute__ ((init_priority (150)))
#endif
static bool dontCleanup = false;
namespace
@ -180,7 +173,7 @@ namespace
}
};
Cleanup global FB_INIT_PRIORITY;
Cleanup global;
#endif //DEBUG_INIT
void init()
@ -215,17 +208,6 @@ namespace
Firebird::MemoryPool::contextPoolInit();
}
class Init
{
public:
Init()
{
init();
}
};
Init initGlobal FB_INIT_PRIORITY;
Firebird::InstanceControl::InstanceList* instanceList = 0;
FPTR_VOID gdsCleanup = 0;
FPTR_VOID gdsShutdown = 0;
@ -234,6 +216,12 @@ namespace
namespace Firebird
{
InstanceControl::InstanceControl()
{
// Initialize required subsystems, including static mutex
init();
}
InstanceControl::InstanceList::InstanceList(DtorPriority p)
: priority(p)
{

View File

@ -55,6 +55,8 @@ public:
PRIORITY_TLS_KEY
};
InstanceControl();
//
// GlobalPtr should not be directly derived from class with virtual functions -
// virtual table for its instances may become invalid in the moment,