Exemplo n.º 1
0
        /// <summary>
        /// Release all the unmanaged memory associated with this object.
        /// </summary>
        protected override void DisposeObject()
        {
            if (_needDispose && _ptr != IntPtr.Zero)
            {
                UMatInvoke.cvUMatRelease(ref _ptr);
            }

            if (_oclMatAllocator != IntPtr.Zero)
            {
                MatDataAllocatorInvoke.cvMatAllocatorRelease(ref _oclMatAllocator);
            }

            base.DisposeObject();
        }
Exemplo n.º 2
0
        /// <summary>
        /// Release resource associated with this object
        /// </summary>
        protected override void DisposeObject()
        {
            if (_memoryAllocator != IntPtr.Zero)
            {
                MatDataAllocatorInvoke.cvMatAllocatorRelease(ref _memoryAllocator);
            }

            if (_allocateDataActionPtr != IntPtr.Zero)
            {
                GCHandle.FromIntPtr(_allocateDataActionPtr).Free();
                _allocateDataActionPtr = IntPtr.Zero;
            }
            if (_freeDataActionPtr != IntPtr.Zero)
            {
                GCHandle.FromIntPtr(_freeDataActionPtr).Free();
                _freeDataActionPtr = IntPtr.Zero;
            }

            FreeData();
        }