{
int mdebug_mask = MDEBUG_INIT;
- if (core_initialized)
+ if (core_initialized++)
return;
merror_code = MERROR_NONE;
mdatabase__finder = NULL;
mdatabase__loader = NULL;
- core_initialized = 1;
err:
MDEBUG_POP_TIME ();
{
int mdebug_mask = MDEBUG_FINI;
- if (core_initialized)
+ if (core_initialized > 1)
+ core_initialized--;
+ else
{
+ core_initialized = 0;
MDEBUG_PUSH_TIME ();
MDEBUG_PUSH_TIME ();
MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize chartable module."));
msymbol__fini ();
MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize plist module."));
mplist__fini ();
- core_initialized = 0;
MDEBUG_POP_TIME ();
MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize the core modules."));
MDEBUG_POP_TIME ();