public static void Dispose() { if (instance != null) { ServiceCache.EventBus.StopCurrentEventPropagation(); instance.container.Dispose(); ServiceCache.Dispose(); instance.servicesRegistered.Clear(); instance.servicesLoaded.Clear(); instance = null; OnDisposed(); OnDisposed = delegate { }; } }
public void Dispose() { lock (mutex) { if (disposed) { return; } notify_listener.Stop(); foreach (Browser browser in browsers.Values) { browser.Dispose(); } browsers.Clear(); service_cache.Dispose(); service_cache = null; notify_listener = null; browsers = null; disposed = true; } }