/////////////////////////////////////////////////////////////////////// private static void ClearTraceCategories() { lock (syncRoot) /* TRANSACTIONAL */ { if (traceCategories != null) { traceCategories.Clear(); } } }
public void Clear() { if (_Lock.Enter(Lock.Mode.Mutex)) { try { for (int i = 0; i < _IndexCount; i++) { IndexBuf[i].MB.Dispose(); } IndexBuf = new IndexElement[(512 * 1024 * 1024) / BufSize]; _DocIdToRank.Clear(); _Count = 0; _IndexCount = 0; //Count of IndexBuf _PayloadSize = 0; //How may elements in one payload data. sizeof(Data). //_CurIndex = 0; //Current index of IndexBuf; } finally { _Lock.Leave(Lock.Mode.Mutex); } } }
internal void DoOnRemove(byte reasonCode) { //do some cleanup _rpcProcessors.Clear(); _fieldProcessors.Clear(); _onSerializeStream = null; OnFinishedCreation = null; OnDeserializeStream = null; try { if (OnRemove != null) { OnRemove(reasonCode); } OnRemove = null; } catch (Exception e) { Debug.LogError(Manager.Net, "[NetworkView.OnRemove] {0}", e); } Manager.RemoveView(this); }
/////////////////////////////////////////////////////////////////////// private /* protected virtual */ void Dispose( bool disposing ) { TraceOps.DebugTrace(String.Format( "Dispose: disposing = {0}, interpreter = {1}, disposed = {2}", disposing, FormatOps.InterpreterNoThrow(interpreter), disposed), typeof(TestContext).Name, TracePriority.CleanupDebug); if (!disposed) { if (disposing) { //////////////////////////////////// // dispose managed resources here... //////////////////////////////////// interpreter = null; /* NOT OWNED: Do not dispose. */ threadId = 0; /////////////////////////////////////////////////////////// targetInterpreter = null; /* NOT OWNED: Do not dispose. */ /////////////////////////////////////////////////////////// statistics = null; /////////////////////////////////////////////////////////// if (constraints != null) { constraints.Clear(); constraints = null; } /////////////////////////////////////////////////////////// if (failures != null) { failures.Clear(); failures = null; } /////////////////////////////////////////////////////////// if (counts != null) { counts.Clear(); counts = null; } /////////////////////////////////////////////////////////// if (match != null) { match.Clear(); match = null; } /////////////////////////////////////////////////////////// if (skip != null) { skip.Clear(); skip = null; } /////////////////////////////////////////////////////////// if (returnCodeMessages != null) { returnCodeMessages.Clear(); returnCodeMessages = null; } /////////////////////////////////////////////////////////// #if DEBUGGER if (breakpoints != null) { breakpoints.Clear(); breakpoints = null; } #endif /////////////////////////////////////////////////////////// path = null; verbose = TestOutputType.None; repeatCount = 0; } ////////////////////////////////////// // release unmanaged resources here... ////////////////////////////////////// disposed = true; } }