summaryrefslogtreecommitdiff
path: root/zend/namespace.cpp
diff options
context:
space:
mode:
authorEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-05-06 09:34:12 +0200
committerEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-05-06 09:34:12 +0200
commitf57607d2d58f6e7689a3550c84ba68ce42c6a7b3 (patch)
tree318f5d63d51106fb34cd6634f7cc8e321da1c1e0 /zend/namespace.cpp
parent927e54ecde25ed7ba718697631dc8ffd208e361a (diff)
When "apache reload" is called, the PHP-CPP library made the entire Apache process crash. This has been fixed
Diffstat (limited to 'zend/namespace.cpp')
-rw-r--r--zend/namespace.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/zend/namespace.cpp b/zend/namespace.cpp
index 2b4b62a..9274bf0 100644
--- a/zend/namespace.cpp
+++ b/zend/namespace.cpp
@@ -22,6 +22,9 @@ namespace Php {
*/
Namespace &Namespace::add(const char *name, const native_callback_0 &function, const Arguments &arguments)
{
+ // skip when locked
+ if (locked()) return *this;
+
// add a function
_functions.push_back(std::make_shared<Function>(name, function, arguments));
@@ -38,6 +41,9 @@ Namespace &Namespace::add(const char *name, const native_callback_0 &function, c
*/
Namespace &Namespace::add(const char *name, const native_callback_1 &function, const Arguments &arguments)
{
+ // skip when locked
+ if (locked()) return *this;
+
// add a function
_functions.push_back(std::make_shared<Function>(name, function, arguments));
@@ -54,6 +60,9 @@ Namespace &Namespace::add(const char *name, const native_callback_1 &function, c
*/
Namespace &Namespace::add(const char *name, const native_callback_2 &function, const Arguments &arguments)
{
+ // skip when locked
+ if (locked()) return *this;
+
// add a function
_functions.push_back(std::make_shared<Function>(name, function, arguments));
@@ -70,6 +79,9 @@ Namespace &Namespace::add(const char *name, const native_callback_2 &function, c
*/
Namespace &Namespace::add(const char *name, const native_callback_3 &function, const Arguments &arguments)
{
+ // skip when locked
+ if (locked()) return *this;
+
// add a function
_functions.push_back(std::make_shared<Function>(name, function, arguments));