features2d_BOWImgDescriptorExtractor_delete() private method

private features2d_BOWImgDescriptorExtractor_delete ( IntPtr obj ) : void
obj IntPtr
return void
/// <summary>
/// リソースの解放
/// </summary>
/// <param name="disposing">
/// trueの場合は、このメソッドがユーザコードから直接が呼ばれたことを示す。マネージ・アンマネージ双方のリソースが解放される。
/// falseの場合は、このメソッドはランタイムからファイナライザによって呼ばれ、もうほかのオブジェクトから参照されていないことを示す。アンマネージリソースのみ解放される。
///</param>
#else
        /// <summary>
        /// Releases the resources
        /// </summary>
        /// <param name="disposing">
        /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed.
        /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed.
        /// </param>
#endif
        protected override void Dispose(bool disposing)
        {
            if (!IsDisposed)
            {
                try
                {
                    // releases managed resources
                    if (disposing)
                    {
                    }
                    else
                    {
                        if (ptr != IntPtr.Zero)
                        {
                            NativeMethods.features2d_BOWImgDescriptorExtractor_delete(ptr);
                        }
                        ptr = IntPtr.Zero;
                    }
                }
                finally
                {
                    base.Dispose(disposing);
                }
            }
        }
示例#2
0
 /// <summary>
 /// Releases unmanaged resources
 /// </summary>
 protected override void DisposeUnmanaged()
 {
     NativeMethods.HandleException(
         NativeMethods.features2d_BOWImgDescriptorExtractor_delete(ptr));
     base.DisposeUnmanaged();
 }