Beispiel #1
0
        /// <summary>
        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
        /// </summary>
        /// <param name="callFromDispose">
        /// The call From Dispose.
        /// </param>
        public void Dispose(bool callFromDispose)
        {
            if (this.IsDisposed)
            {
                return;
            }

            IsDisposed = true;

            if (this.unmanagedHandle != IntPtr.Zero)
            {
                MarshalHunspellDll.HunspellFree(this.unmanagedHandle);
                this.unmanagedHandle = IntPtr.Zero;
            }

            if (this.nativeDllIsReferenced)
            {
                MarshalHunspellDll.UnReferenceNativeHunspellDll();
                this.nativeDllIsReferenced = false;
            }

            if (callFromDispose)
            {
                GC.SuppressFinalize(this);
            }
        }
Beispiel #2
0
        /// <summary>
        /// The dispose.
        /// </summary>
        /// <param name="callFromDispose">
        /// The call From Dispose.
        /// </param>
        protected virtual void Dispose(bool callFromDispose)
        {
            if (this.IsDisposed)
            {
                return;
            }

            IsDisposed = true;

            if (this.unmanagedHandle != IntPtr.Zero)
            {
                MarshalHunspellDll.HyphenFree(this.unmanagedHandle);
                this.unmanagedHandle = IntPtr.Zero;
            }

            if (this.nativeDllIsReferenced)
            {
                MarshalHunspellDll.UnReferenceNativeHunspellDll();
                this.nativeDllIsReferenced = false;
            }
        }