Henry Jen wrote:
Hi,

The debug version of apr_poor_terminate does not support nested initialization as regular version, is this a bug or on purpose?

I guess it is a bug, but want to hear second opinion. :-)



I guess no one would care if there is no patch available. So here is a patch. :-)

Cheers,
Henry
Index: memory/unix/apr_pools.c
===================================================================
--- memory/unix/apr_pools.c	(revision 230894)
+++ memory/unix/apr_pools.c	(working copy)
@@ -1264,7 +1264,8 @@
     if (!apr_pools_initialized)
         return;
 
-    apr_pools_initialized = 0;
+    if (--apr_pools_initialized)
+        return;
 
     apr_pool_destroy(global_pool); /* This will also destroy the mutex */
     global_pool = NULL;

Reply via email to