private static void DisposeObject(object objectToDispose) { if (objectToDispose == null) { return; } var referenceableObject = objectToDispose as IReferencable; if (referenceableObject != null) { referenceableObject.Release(); return; } var disposableObject = objectToDispose as IDisposable; if (disposableObject != null) { disposableObject.Dispose(); } else { var localData = objectToDispose; var dataPointer = (IntPtr)localData; Utilities.FreeMemory(dataPointer); } }
public void Dispose() { if (!isShared) { Utilities.FreeMemory(Pointer); } }
public void Dispose() { Utilities.FreeMemory(Pointer); }