public void WaitForStop( ) { if ( thread != null ) { // wait for thread stop thread.Join( ); Free( ); } }