Skip to content

Commit cf6c354

Browse files
committed
Run other RSHUTDOWN handlers if one fails
Motivated by bug #81316: If one RSHUTDOWN handler fails, still run the other ones. They may be doing something important...
1 parent f603934 commit cf6c354

File tree

1 file changed

+16
-18
lines changed

1 file changed

+16
-18
lines changed

Zend/zend_API.c

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2978,29 +2978,27 @@ ZEND_API void zend_deactivate_modules(void) /* {{{ */
29782978
{
29792979
EG(current_execute_data) = NULL; /* we're no longer executing anything */
29802980

2981-
zend_try {
2982-
if (EG(full_tables_cleanup)) {
2983-
zend_module_entry *module;
2981+
if (EG(full_tables_cleanup)) {
2982+
zend_module_entry *module;
29842983

2985-
ZEND_HASH_REVERSE_FOREACH_PTR(&module_registry, module) {
2986-
if (module->request_shutdown_func) {
2987-
#if 0
2988-
zend_printf("%s: Request shutdown\n", module->name);
2989-
#endif
2984+
ZEND_HASH_REVERSE_FOREACH_PTR(&module_registry, module) {
2985+
if (module->request_shutdown_func) {
2986+
zend_try {
29902987
module->request_shutdown_func(module->type, module->module_number);
2991-
}
2992-
} ZEND_HASH_FOREACH_END();
2993-
} else {
2994-
zend_module_entry **p = module_request_shutdown_handlers;
2995-
2996-
while (*p) {
2997-
zend_module_entry *module = *p;
2988+
} zend_end_try();
2989+
}
2990+
} ZEND_HASH_FOREACH_END();
2991+
} else {
2992+
zend_module_entry **p = module_request_shutdown_handlers;
29982993

2994+
while (*p) {
2995+
zend_module_entry *module = *p;
2996+
zend_try {
29992997
module->request_shutdown_func(module->type, module->module_number);
3000-
p++;
3001-
}
2998+
} zend_end_try();
2999+
p++;
30023000
}
3003-
} zend_end_try();
3001+
}
30043002
}
30053003
/* }}} */
30063004

0 commit comments

Comments
 (0)