Ignore:
Timestamp:
Jun 1, 2007 7:26:21 AM (16 years ago)
Author:
bennylp
Message:

Implement ticket #314: Added PJ_SAFE_POOL configuration in PJLIB to track down memory corruptions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjlib/src/pj/pool_caching.c

    r1235 r1333  
    100100        pj_pool_t *next = pool->next; 
    101101        pj_list_erase(pool); 
     102        PJ_LOG(4,(pool->obj_name,  
     103                  "Pool is not released by application, releasing now")); 
    102104        pj_pool_destroy_int(pool); 
    103105        pool = next; 
     
    198200    PJ_CHECK_STACK(); 
    199201 
     202    PJ_ASSERT_ON_FAIL(pf && pool, return); 
     203 
    200204    pj_lock_acquire(cp->lock); 
     205 
     206#if PJ_SAFE_POOL 
     207    /* Make sure pool is still in our used list */ 
     208    if (pj_list_find_node(&cp->used_list, pool) != pool) { 
     209        pj_assert(!"Attempt to destroy pool that has been destroyed before"); 
     210        return; 
     211    } 
     212#endif 
    201213 
    202214    /* Erase from the used list. */ 
Note: See TracChangeset for help on using the changeset viewer.