On Wed, 2008-08-06 at 12:46 +0200, Ruediger Pluem wrote:
> I am worried about the case that the destructor might allocate
> memory from the pool for temporary purposes (ok that would be a
> memory leak in the long run).
Not only that, but if you have a look at testreslist.c, you'll find
this:
----------------------------
static apr_status_t my_destructor(void *resource, void *params,
apr_pool_t *pool)
{
my_resource_t *res = resource;
my_parameters_t *my_params = params;
res->id = my_params->d_count++;
apr_sleep(my_params->sleep_upon_destruct);
return APR_SUCCESS;
}
----------------------------
The line "res->id = my_params->d_count++;" is updating a common
structure. Previously, this would be done under a lock in all
circumstances. With the change, this would no longer be the case. This
has potential to cause havoc in existing code. No?
--
Bojan