/// <summary> /// Release all the unmanaged memory associated with this background model. /// </summary> protected override void DisposeObject() { if (IntPtr.Zero != _ptr) { ContribInvoke.cveBackgroundSubtractorMOGRelease(ref _ptr, ref _sharedPtr); _backgroundSubtractorPtr = IntPtr.Zero; _algorithmPtr = IntPtr.Zero; } }