summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2015-04-03 10:48:46 +0200
committerEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2015-04-03 10:48:46 +0200
commit23675c8987be342590b89177b9d29d4a853eacca (patch)
tree279185ec60091ff02004b2cf07112165f8e5d62f
parent8e55c2c08caf9f45d7669684e492b83ec74664ee (diff)
fixed a crash when dynamicly loaded extensions were unloaded, the static cache in PHP-CPP with all the extension names to extension pointers, and the extension numbers to extension pointers are now cleanup up when an extension is unloadedv1.3.2
-rw-r--r--zend/extensionimpl.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/zend/extensionimpl.cpp b/zend/extensionimpl.cpp
index d313498..bacf80f 100644
--- a/zend/extensionimpl.cpp
+++ b/zend/extensionimpl.cpp
@@ -130,6 +130,9 @@ int ExtensionImpl::processShutdown(int type, int module_number TSRMLS_DC)
// get the extension
auto *extension = find(module_number TSRMLS_CC);
+ // we no longer need the number-to-extension mapping
+ number2extension.erase(module_number);
+
// done
return BOOL2SUCCESS(extension->shutdown(module_number TSRMLS_CC));
}
@@ -255,6 +258,9 @@ ExtensionImpl::ExtensionImpl(Extension *data, const char *name, const char *vers
*/
ExtensionImpl::~ExtensionImpl()
{
+ // remove from the array
+ name2extension.erase(_entry.name);
+
// deallocate the php.ini entries
if (_ini) delete[] _ini;