Ignore:
Timestamp:
2/8/2010 8:25:51 AM (2 years ago)
Author:
lowjoel
Message:

Allow all IDisposable patterns to be reentrant. Addresses #275: Code Review

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eraser6/CodeReview/Eraser.Manager/RemoteExecutor.cs

    r1745 r1772  
    104104        protected override void Dispose(bool disposing) 
    105105        { 
     106            if (thread == null || serverLock == null) 
     107                return; 
     108 
    106109            if (disposing) 
    107110            { 
    108111                //Close the polling thread that creates new server instances 
    109112                thread.Abort(); 
     113                thread.Join(); 
    110114 
    111115                //Close all waiting streams 
     
    121125            } 
    122126 
     127            thread = null; 
     128            serverLock = null; 
    123129            base.Dispose(disposing); 
    124130        } 
     
    315321        protected override void Dispose(bool disposing) 
    316322        { 
     323            if (client == null) 
     324                return; 
     325 
    317326            if (disposing) 
    318327            { 
     
    320329            } 
    321330 
     331            client = null; 
    322332            base.Dispose(disposing); 
    323333        } 
Note: See TracChangeset for help on using the changeset viewer.