Skip to content

Commit 92c23e1

Browse files
committed
Call zend_unregister_ini_entries() when unload extension loaded through dl() without MSHUTDOWN callback.
Extensions with MSHUTDOWN should use UNREGISTER_INI_ENTRIES().
1 parent 42a2fb8 commit 92c23e1

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

Zend/zend_API.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2562,6 +2562,12 @@ void module_destructor(zend_module_entry *module) /* {{{ */
25622562
module->module_shutdown_func(module->type, module->module_number);
25632563
}
25642564

2565+
if (module->module_started
2566+
&& !module->module_shutdown_func
2567+
&& module->type == MODULE_TEMPORARY) {
2568+
zend_unregister_ini_entries(module->module_number);
2569+
}
2570+
25652571
/* Deinitilaise module globals */
25662572
if (module->globals_size) {
25672573
#ifdef ZTS

ext/gd/gd.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1235,6 +1235,7 @@ PHP_MSHUTDOWN_FUNCTION(gd)
12351235
#if defined(HAVE_GD_FREETYPE) && defined(HAVE_GD_BUNDLED)
12361236
gdFontCacheMutexShutdown();
12371237
#endif
1238+
UNREGISTER_INI_ENTRIES();
12381239
return SUCCESS;
12391240
}
12401241
/* }}} */

ext/phar/phar.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3428,6 +3428,7 @@ PHP_MSHUTDOWN_FUNCTION(phar) /* {{{ */
34283428
zend_hash_destroy(&(cached_alias));
34293429
}
34303430

3431+
UNREGISTER_INI_ENTRIES();
34313432
return SUCCESS;
34323433
}
34333434
/* }}} */

0 commit comments

Comments
 (0)