Mladen Turk wrote:
Again, the global allocator might get destroyed before the child pool since for it the owner is global pool.
Interesting observation, hinging on being a bug itself.
Making sure that apr_terminate is called as last makes the need for tracking the child pools, and it breaks the OO language paradigm. The point is that one can call apr_terminate at some exit point, but that would require to wait for all objects to detach itself, and make event mechanism for breaking the long running functions (like file or network).
Nope. As in most object paradigms, init/terminate is reference counted and final destruction is held for refcount reaching zero.
