From 23675c8987be342590b89177b9d29d4a853eacca Mon Sep 17 00:00:00 2001 From: Emiel Bruijntjes Date: Fri, 3 Apr 2015 10:48:46 +0200 Subject: 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 unloaded --- zend/extensionimpl.cpp | 6 ++++++ 1 file changed, 6 insertions(+) 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; -- cgit v1.2.3