예제 #1
0
파일: Xpcom.cs 프로젝트: Arsslensoft/ALFX
        public static void Shutdown()
        {
            Xpcom.DisposeObject(ref _comGC);

            if (ComponentRegistrar != null)
            {
                Marshal.ReleaseComObject(ComponentRegistrar);
            }

            if (ComponentManager != null)
            {
                Marshal.ReleaseComObject(ComponentManager);
            }

            if (ServiceManager != null)
            {
                // NS_ShutdownXPCOM calls Release on the ServiceManager COM objects.
                // However since the ServiceManager is a __ComObject its finaliser will also call release.
                var ptr = Marshal.GetIUnknownForObject(ServiceManager);
                NS_ShutdownXPCOM(ServiceManager);
                Marshal.ReleaseComObject(ServiceManager);
            }

            _IsInitialized = false;
        }
 public void Dispose()
 {
     if (_inputStream != null)
     {
         Xpcom.DisposeObject(ref _inputStream);
     }
     _inputStream = null;
     GC.SuppressFinalize(this);
 }
예제 #3
0
        public static void Shutdown()
        {
            GeckoPreferences.Shutdown();
            WindowWatcher.Shutdown();
            WindowMediator.Shutdown();

            PromptFactoryFactory.Shutdown();
            Xpcom.DisposeObject(ref _comGC);

            if (Xpcom.ChromeContext != null)
            {
                Xpcom.ChromeContext.Dispose();
                Xpcom.ChromeContext = null;
            }

            if (ComponentRegistrar != null)
            {
                Marshal.ReleaseComObject(ComponentRegistrar);
            }

            if (ComponentManager != null)
            {
                Marshal.ReleaseComObject(ComponentManager);
            }

            if (ServiceManager != null)
            {
                var s = GetService <nsIObserverService>("@mozilla.org/observer-service;1");
                s.NotifyObservers(null, "profile-change-net-teardown", "shutdown-persist");
                s.NotifyObservers(null, "profile-change-teardown", "shutdown-persist");
                s.NotifyObservers(null, "profile-before-change", "shutdown-persist");
                s.NotifyObservers(null, "profile-before-change2", "shutdown-persist");
                Marshal.ReleaseComObject(s);

                // NS_ShutdownXPCOM calls Release on the ServiceManager COM objects.
                // However since the ServiceManager is a __ComObject its finaliser will also call release.
                var ptr = Marshal.GetIUnknownForObject(ServiceManager);
                NS_ShutdownXPCOM(ServiceManager);
                Marshal.ReleaseComObject(ServiceManager);
            }

            _IsInitialized = false;
        }
예제 #4
0
파일: Xpcom.cs 프로젝트: loundar/geckofx-29
        public static void Shutdown()
        {
            GeckoPreferences.Shutdown();
            WindowWatcher.Shutdown();
            WindowMediator.Shutdown();

            PromptFactoryFactory.Shutdown();
            Xpcom.DisposeObject(ref _comGC);

            if (Xpcom.ChromeContext != null)
            {
                Xpcom.ChromeContext.Dispose();
                Xpcom.ChromeContext = null;
            }

            if (ComponentRegistrar != null)
            {
                Marshal.ReleaseComObject(ComponentRegistrar);
            }

            if (ComponentManager != null)
            {
                Marshal.ReleaseComObject(ComponentManager);
            }

            if (ServiceManager != null)
            {
                // NS_ShutdownXPCOM calls Release on the ServiceManager COM objects.
                // However since the ServiceManager is a __ComObject its finaliser will also call release.
                var ptr = Marshal.GetIUnknownForObject(ServiceManager);
                NS_ShutdownXPCOM(ServiceManager);
                Marshal.ReleaseComObject(ServiceManager);
            }

            _IsInitialized = false;
        }
예제 #5
0
 public void Dispose()
 {
     Xpcom.DisposeObject(ref _collection);
     GC.SuppressFinalize(this);
 }
예제 #6
0
 public void Dispose()
 {
     Xpcom.DisposeObject(ref _domNode);
     GC.SuppressFinalize(this);
 }
예제 #7
0
 public void Dispose()
 {
     Xpcom.DisposeObject(ref _domWindowProxy);
     GC.SuppressFinalize(this);
 }
예제 #8
0
 public void Dispose()
 {
     Xpcom.DisposeObject(ref _inputStream);
 }