示例#1
0
        public int Release()
        {
            if (!this.isInit)
            {
                return(LibErrors.SUCCESS);
            }

            this.isInit = false;

            Marshal.FreeHGlobal(this.pwfx_free);
            Marshal.Release(this.pdsb8);
            Marshal.Release(this.pds8);
            //Marshal.ReleaseComObject(this.dsb8);
            //Marshal.ReleaseComObject(this.ds8);
            Marshal.FinalReleaseComObject(this.dsb8);
            Marshal.FinalReleaseComObject(this.ds8);

            this.pwfx_free = IntPtr.Zero;

            this.pdsb8 = IntPtr.Zero;
            this.pds8  = IntPtr.Zero;

            this.dsb8 = null;
            this.ds8  = null;

            foreach (var item in notifyHwnd_close)
            {
                LibNatives.CloseHandle(item);
            }
            this.notifyHwnd_close = null;
            this.rgdsbpn          = null;

            return(LibErrors.SUCCESS);
        }
示例#2
0
        public int Release()
        {
            Marshal.FreeHGlobal(this.pwfx_free);
            Marshal.Release(this.pdscb8);
            Marshal.Release(this.pdsc8);
            //Marshal.ReleaseComObject(this.dscb8);
            //Marshal.ReleaseComObject(this.dsc8);
            Marshal.FinalReleaseComObject(this.dscb8);
            Marshal.FinalReleaseComObject(this.dsc8);

            this.pwfx_free = IntPtr.Zero;

            this.pdscb8 = IntPtr.Zero;
            this.pdsc8  = IntPtr.Zero;

            this.dscb8 = null;
            this.dsc8  = null;

            foreach (var hwnd in this.notifyHwnd_close)
            {
                LibNatives.CloseHandle(hwnd);
            }
            this.notifyHwnd_close = null;

            return(LibErrors.SUCCESS);
        }