[PECL-CVS] [pecl-datetime-timezonedb] fix/issue-16-segfault-on-reload: Fixes #16

[email protected] (Rasmus Lerdorf) Sun, 5 Apr 2026 14:54:08 +0000
Newsgroups php.pecl.cvs
Message-ID <[email protected]>
Author: Rasmus Lerdorf (rlerdorf)
Date: 2026-04-05T10:53:50-04:00

Commit: https://github.com/php/pecl-datetime-timezonedb/commit/2749f52ced3b760173e82f000e0c0acdb0898982
Raw diff: https://github.com/php/pecl-datetime-timezonedb/commit/2749f52ced3b760173e82f000e0c0acdb0898982.diff

Fixes #16

Changed paths:
  M  php_timezonedb.h
  M  timezonedb.c


Diff:

diff --git a/php_timezonedb.h b/php_timezonedb.h
index 80cf450..8f73c04 100644
--- a/php_timezonedb.h
+++ b/php_timezonedb.h
@@ -29,6 +29,7 @@ extern zend_module_entry timezonedb_module_entry;
 #define PHP_TIMEZONEDB_VERSION "2026.1"
 
 PHP_MINIT_FUNCTION(timezonedb);
+PHP_MSHUTDOWN_FUNCTION(timezonedb);
 PHP_MINFO_FUNCTION(timezonedb);
 
 #endif	/* TIMEZONEDB_H */
diff --git a/timezonedb.c b/timezonedb.c
index daf34ae..92a4efb 100644
--- a/timezonedb.c
+++ b/timezonedb.c
@@ -76,7 +76,7 @@ zend_module_entry timezonedb_module_entry = {
 	"timezonedb",
 	timezonedb_functions,
 	PHP_MINIT(timezonedb),
-	NULL,
+	PHP_MSHUTDOWN(timezonedb),
 	NULL,
 	NULL,
 	PHP_MINFO(timezonedb),
@@ -102,6 +102,7 @@ PHP_MINIT_FUNCTION(timezonedb)
  */
 PHP_MSHUTDOWN_FUNCTION(timezonedb)
 {
+	php_date_set_tzdb((timelib_tzdb *) timelib_builtin_db());
 	return SUCCESS;
 }
 /* }}} */