示例#1
0
        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 { };
            }
        }
示例#2
0
        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;
            }
        }