Changeset 3559


Ignore:
Timestamp:
May 6, 2011 7:25:59 AM (14 years ago)
Author:
bennylp
Message:

Fixed #1251: Calling pjmedia_aud_subsys_shutdown() more than once may cause crash (thanks Bill Gardner for the patch)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/1.x/pjmedia/src/pjmedia-audiodev/audiodev.c

    r3553 r3559  
    489489    --aud_subsys.init_count; 
    490490 
    491     for (i=0; i<aud_subsys.drv_cnt; ++i) { 
    492         deinit_driver(i); 
    493     } 
    494  
    495     aud_subsys.pf = NULL; 
     491    if (aud_subsys.init_count == 0) { 
     492        for (i=0; i<aud_subsys.drv_cnt; ++i) { 
     493            deinit_driver(i); 
     494        } 
     495 
     496        aud_subsys.pf = NULL; 
     497    } 
    496498    return PJ_SUCCESS; 
    497499} 
Note: See TracChangeset for help on using the changeset viewer.