Пример #1
0
        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);
            }
        }
Пример #2
0
 public void Dispose()
 {
     if (!isShared)
     {
         Utilities.FreeMemory(Pointer);
     }
 }
Пример #3
0
 public void Dispose()
 {
     Utilities.FreeMemory(Pointer);
 }