On 08/23/2010 04:53 PM, Christian K. wrote:
Hello,
In this application I want to write a dbm file, to use for HTTPD
authentication. Since I do not want to make any assumption on the
initialization state of apr I would like to repeatedly initialize and
terminate apr.
IMHO this is API misuse.
It's not a problem if you call apr_initialize or apr_terminate
multiple times, since only the first and last will actually
do the job (although they are not thread safe).
However apr_terminate is meant to be used at process exit
as a top level cleanup.
See:
http://apr.apache.org/docs/apr/1.4/group__apr__library.html
It clearly states that apr_initialize/apr_terminate should be
used as entry and exit point to the *library* (which usually
translates to a single calls per process life time)
Regards
--
^TM