private void Unmap(string uuid) { DapSource source = null; lock (sync) { if (sources == null) { // DapService already disposed... return; } if (sources.ContainsKey(uuid)) { Log.DebugFormat("Unmapping DAP source ({0})", uuid); source = sources[uuid]; sources.Remove(uuid); } } if (source != null) { source.Dispose(); ThreadAssist.ProxyToMain(delegate { try { ServiceManager.SourceManager.RemoveSource(source); } catch (Exception e) { Log.Exception(e); } }); } }
internal void UnmapDevice(string uuid) { DapSource source = null; lock (sync) { if (sources.ContainsKey(uuid)) { Log.DebugFormat("Unmapping DAP source ({0})", uuid); source = sources[uuid]; sources.Remove(uuid); } } if (source != null) { try { source.Dispose(); ThreadAssist.ProxyToMain(delegate { ServiceManager.SourceManager.RemoveSource(source); }); } catch (Exception e) { Log.Exception(e); } } }
private void Unmap(string uuid) { DapSource source = null; lock (sync) { if (sources == null) { Log.WarningFormat("Dap.DapService: already Disposed, can't unmap {0}", uuid); return; } if (sources.ContainsKey(uuid)) { Log.DebugFormat("Unmapping DAP source ({0})", uuid); source = sources[uuid]; sources.Remove(uuid); } } if (source != null) { source.RequestUnmap -= OnRequestUnmap; source.Dispose(); ThreadAssist.ProxyToMain(delegate { try { ServiceManager.SourceManager.RemoveSource(source); } catch (Exception e) { Log.Error(e); } }); } }