diff options
author | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2014-05-06 09:34:12 +0200 |
---|---|---|
committer | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2014-05-06 09:34:12 +0200 |
commit | f57607d2d58f6e7689a3550c84ba68ce42c6a7b3 (patch) | |
tree | 318f5d63d51106fb34cd6634f7cc8e321da1c1e0 /zend/extensionimpl.cpp | |
parent | 927e54ecde25ed7ba718697631dc8ffd208e361a (diff) |
When "apache reload" is called, the PHP-CPP library made the entire Apache process crash. This has been fixed
Diffstat (limited to 'zend/extensionimpl.cpp')
-rw-r--r-- | zend/extensionimpl.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/zend/extensionimpl.cpp b/zend/extensionimpl.cpp index ea0c049..f073acf 100644 --- a/zend/extensionimpl.cpp +++ b/zend/extensionimpl.cpp @@ -142,6 +142,10 @@ int ExtensionImpl::processStartup(int type, int module_number TSRMLS_DC) // initialize the extension extension->initialize(TSRMLS_C); + // remember that we're initialized (when you use "apache reload" it is + // possible that the processStartup() method is called more than once) + extension->_locked = true; + // is the callback registered? if (extension->_onStartup) extension->_onStartup(); @@ -164,6 +168,12 @@ int ExtensionImpl::processShutdown(int type, int module_number TSRMLS_DC) // unregister the ini entries zend_unregister_ini_entries(module_number TSRMLS_CC); + // destruct the ini entries + if (extension->_ini) delete[] extension->_ini; + + // forget the ini entries + extension->_ini = nullptr; + // is the callback registered? if (extension->_onShutdown) extension->_onShutdown(); @@ -272,7 +282,7 @@ ExtensionImpl::~ExtensionImpl() */ zend_module_entry *ExtensionImpl::module() { - // check if functions we're already defined + // check if functions were already defined if (_entry.functions) return &_entry; // the number of functions |