Changeset 4160 for pjproject


Ignore:
Timestamp:
Jun 7, 2012 4:10:22 AM (12 years ago)
Author:
nanang
Message:

Fix #1531: fixed memory and handle leak issue in clock thread.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/src/pjmedia/clock_thread.c

    r4106 r4160  
    166166                     p_clock, PJ_EINVAL); 
    167167 
    168     pool = pj_pool_create(pool->factory, "clock%p", 512, 512, NULL); 
    169  
    170168    clock = PJ_POOL_ALLOC_T(pool, pjmedia_clock); 
    171     clock->pool = pool; 
    172      
     169    clock->pool = pj_pool_create(pool->factory, "clock%p", 512, 512, NULL); 
     170 
    173171    status = pj_get_timestamp_freq(&clock->freq); 
    174172    if (status != PJ_SUCCESS) 
     
    226224                                  0, 0, &clock->thread); 
    227225        if (status != PJ_SUCCESS) { 
    228             pj_lock_destroy(clock->lock); 
     226            clock->running = PJ_FALSE; 
    229227            return status; 
    230228        } 
     
    247245    if (clock->thread) { 
    248246        if (pj_thread_join(clock->thread) == PJ_SUCCESS) { 
     247            pj_thread_destroy(clock->thread); 
    249248            clock->thread = NULL; 
     249            pj_pool_reset(clock->pool); 
    250250        } else { 
    251251            clock->quitting = PJ_FALSE; 
Note: See TracChangeset for help on using the changeset viewer.