if (*mem) {
ap_slotmem_instance_t *next = *mem;
- apr_pool_t *p = next->gpool;
while (next) {
if (AP_SLOTMEM_IS_PERSIST(next)) {
store_slotmem(next);
apr_shm_destroy((apr_shm_t *)next->shm);
next = next->next;
}
- apr_pool_destroy(p);
- } else {
- /* If shared mem was never called, then just remove
- * the global pool */
- apr_pool_destroy(gpool);
}
return APR_SUCCESS;
}
}
}
if (i >= slot->desc.num) {
- return APR_ENOSHMAVAIL;
+ return APR_EINVAL;
}
*inuse = 1;
*id = i;
/* initialise the global pool */
static void slotmem_shm_initgpool(apr_pool_t *p)
{
- gpool = p;
+ if (!gpool && p) {
+ gpool = p;
+ }
}
/* Add the pool_clean routine */