public override void Close() { base.Close(); m_raysStartPositions.Clear(); m_raysStartPositions = null; m_work = null; }
private void ScanBuffer(ITextSnapshot snapshot) { if (this.scan != null) { //Stop and blow away the old scan (even if it didn't finish, the results are not interesting anymore). this.scan.Abort(); this.scan = null; } //The underlying buffer could be very large, meaning that doing the scan for all matches on the UI thread //is a bad idea. Do the scan on the background thread and use a callback to raise the changed event when //the entire scan has completed. this.scan = new BackgroundScan(snapshot, this.parser, delegate(CodeBlock newRoot) { //This delegate is executed on a background thread. this.root = newRoot; EventHandler <SnapshotSpanEventArgs> handler = _tagsChanged; if (handler != null) { handler(this, new SnapshotSpanEventArgs(new SnapshotSpan(snapshot, 0, snapshot.Length))); } }); }
public void Release() { if (--_refCount == 0) { _buffer.Changed -= OnChanged; if (_scan != null) { //Stop and blow away the old scan (even if it didn't finish, the results are not interesting anymore). _scan.Cancel(); _scan = null; } _root = null; //Allow the old root to be GC'd } }
public MyPrefabScanningPartRays(MyPrefabScanner scanner) : base(scanner) { m_work = new BackgroundScan(scanner); m_raysStartPositions = new List <Vector3>(); }
public MyPrefabScanningPartRays(MyPrefabScanner scanner) : base(scanner) { m_work = new BackgroundScan(scanner); m_raysStartPositions = new List<Vector3>(); }