Skip to content

Commit d7af9da

Browse files
committed
Close all observer end handlers before shutdown functions
Also update observed frame arena size
1 parent 7ff4b63 commit d7af9da

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

Zend/zend_observer.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,7 @@ ZEND_API void zend_observer_startup(void) {
8282
ZEND_API void zend_observer_activate(void) {
8383
if (ZEND_OBSERVER_ENABLED) {
8484
fcall_handlers_arena = zend_arena_create(4096);
85-
// TODO: How big should the arena be?
86-
observed_stack_arena = zend_arena_create(2048);
85+
observed_stack_arena = zend_arena_create(4096);
8786
}
8887
}
8988

main/main.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1747,16 +1747,16 @@ void php_request_shutdown(void *dummy)
17471747

17481748
php_deactivate_ticks();
17491749

1750+
/* 0. Call any open observer end handlers that are still open after a zend_bailout */
1751+
if (ZEND_OBSERVER_ENABLED) {
1752+
zend_observer_fcall_end_all();
1753+
}
1754+
17501755
/* 1. Call all possible shutdown functions registered with register_shutdown_function() */
17511756
if (PG(modules_activated)) {
17521757
php_call_shutdown_functions();
17531758
}
17541759

1755-
/* 1.5. Call any open end handlers that are still open after a zend_bailout */
1756-
if (ZEND_OBSERVER_ENABLED) {
1757-
zend_observer_fcall_end_all();
1758-
}
1759-
17601760
/* 2. Call all possible __destruct() functions */
17611761
zend_try {
17621762
zend_call_destructors();

0 commit comments

Comments
 (0)