예제 #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);
            }
        }
예제 #2
0
 /// <summary>
 /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
 /// </summary>
 public void Dispose()
 {
     if (!this.IsDisposed)
     {
         MarshalHunspellDll.HunspellFree(this.unmanagedHandle);
         this.unmanagedHandle = IntPtr.Zero;
     }
 }
예제 #3
0
        /// <summary>
        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
        /// </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.HunspellFree(this.unmanagedHandle);
                this.unmanagedHandle = IntPtr.Zero;
            }

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