From Angelo Moscati:
I found something about memory managment in apache with c++:
Integrating C++ destructor-cleanup code provides yet another example:
Suppose we have:
class myclass {
public:
virtual ~myclass() { do cleanup ; }
// ....
} ;
We define a C wrapper:
void myclassCleanup(void* ptr) { delete (myclass*)ptr ; }
and register it with the pool when we allocate myclass:
myclass* myobj = new myclass(...) ;
apr_pool_cleanup_register(pool, (void*)myobj, myclassCleanup,
apr_pool_cleanup_null) ;
// now we've hooked our existing resource management from C++
// into apache and never need to delete myobj
This is from the website:
http://www.apachetutor.org/dev/pools
Thanks again
Angelo
Back to Apache C++ Cookbook