apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yann Lavictoire" <ylavicto...@netsecureone.com>
Subject [PATCH] apr-1.1.0/locks/win32/thread_cond.c
Date Fri, 11 Mar 2005 16:27:36 GMT
Hello,

'pool_cleanup_register(cond, thread_cond_cleanup)' call is missing in 'apr_thread_cond_create()'
while
'apr_thread_cond_destroy()' calls 'pool_cleanup_run(cond)' (ie. HANDLEs leakage not only on
"external" pool cleanup).

Sorry for my frenchy english.
Bye,
Yann.

The patch :

--- apr-1.1.0/locks/win32/thread_cond.old.c	2004-11-24 22:51:50.000000000 +0000
+++ apr-1.1.0/locks/win32/thread_cond.c	2005-03-11 16:02:53.000000000 +0000
@@ -38,6 +38,9 @@
     (*cond)->mutex = CreateMutex(NULL, FALSE, NULL);
     (*cond)->signal_all = 0;
     (*cond)->num_waiting = 0;
+
+    apr_pool_cleanup_register((*cond)->pool, (*cond), thread_cond_cleanup,
+                              apr_pool_cleanup_null);
     return APR_SUCCESS;
 }


Mime
View raw message