[Modcplusplus-devel] (gr84b8) apr_cplusplus/src/pools cpp_pools.cpp
Brought to you by:
gr84b8,
johnksterling
From: Mod C. C. L. <mod...@so...> - 2001-11-21 17:05:34
|
Mod Cplusplus CVS committal Author : gr84b8 Project : apr_cplusplus Module : src Dir : apr_cplusplus/src/pools Modified Files: cpp_pools.cpp Log Message: pool instancation registers a cleanup to delete the pool object when the pool goes away. =================================================================== RCS file: /cvsroot/modcplusplus/apr_cplusplus/src/pools/cpp_pools.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- cpp_pools.cpp 2001/11/21 16:50:45 1.1 +++ cpp_pools.cpp 2001/11/21 17:05:32 1.2 @@ -1,10 +1,20 @@ #include <string.h> #include "cpp_pools.h" +extern "C" { + apr_status_t cleanup_pool_object(void *data) { + APRPool *pPool = (APRPool *)data; + delete pPool; + return 0; + } +} + APRPool::APRPool(apr_pool_t *pool) { mPool = pool; mHash = new APRHash(pool); + apr_pool_cleanup_register(pool, this, cleanup_pool_object, + cleanup_pool_object); } void APRPool::RegisterObject(const char *name, APRPoolObject *pObject) |