Changeset 821


Ignore:
Timestamp:
Nov 23, 2006 7:31:27 AM (18 years ago)
Author:
bennylp
Message:

Fixed crash in IoCompletionPort? during unregistration. Also remove WSACleanup() from pj_shutdown() since it may not be a good idea (and for one thing it crashes with Invalid Handle exception)

Location:
pjproject/trunk/pjlib/src/pj
Files:
2 edited

Legend:

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

    r599 r821  
    688688    } 
    689689#endif 
     690 
     691#if PJ_IOQUEUE_HAS_SAFE_UNREG 
     692    /* Mark key as closing before closing handle. */ 
     693    key->closing = 1; 
     694#endif 
    690695     
    691696    /* Close handle (the only way to disassociate handle from IOCP).  
     
    702707 
    703708#if PJ_IOQUEUE_HAS_SAFE_UNREG 
    704     /* Mark key as closing. */ 
    705     key->closing = 1; 
    706  
    707     /* Decrement reference counter. */ 
    708     decrement_counter(key); 
    709  
    710709    /* Even after handle is closed, I suspect that IOCP may still try to 
    711710     * do something with the handle, causing memory corruption when pool 
     
    715714     * an ugly solution.. 
    716715     */ 
    717     pj_thread_sleep(0); 
     716    while (pj_atomic_get(key->ref_count) != 1) 
     717        pj_thread_sleep(0); 
     718 
     719    /* Decrement reference counter to destroy the key. */ 
     720    decrement_counter(key); 
    718721#endif 
    719722 
  • pjproject/trunk/pjlib/src/pj/os_core_win32.c

    r815 r821  
    220220 
    221221    /* Shutdown Winsock */ 
    222     WSACleanup(); 
     222    //WSACleanup(); 
    223223} 
    224224 
Note: See TracChangeset for help on using the changeset viewer.