コード例 #1
0
ファイル: Realm.cs プロジェクト: quiet324/realm-dotnet
 public void Close()
 {
     if (IsClosed)
     {
         return;
     }
     RuntimeHelpers.PrepareConstrainedRegions();
     try { /* Close handle in a constrained execution region */ }
     finally {
         // Note we expect this call to also do explicit native close first rather than relying on destruction
         // in case other handles preserve pointers - they will no longer work but don't stop closing
         SharedRealmHandle.Close();
     }
 }
コード例 #2
0
ファイル: Realm.cs プロジェクト: dave55/realm-dotnet
        private void Dispose(bool disposing)
        {
            if (IsClosed)
            {
                return;
            }

            if (disposing && !(SharedRealmHandle is UnownedRealmHandle))
            {
                SharedRealmHandle.CloseRealm();
            }

            SharedRealmHandle.Close();  // Note: this closes the *handle*, it does not trigger realm::Realm::close().
        }
コード例 #3
0
ファイル: Realm.cs プロジェクト: joobn72/realm-dotnet
        private void Dispose(bool disposing)
        {
            if (IsClosed)
            {
                throw new ObjectDisposedException(nameof(Realm));
            }

            if (disposing && !(SharedRealmHandle is UnownedRealmHandle))
            {
                SharedRealmHandle.CloseRealm();
            }

            SharedRealmHandle.Close();  // Note: this closes the *handle*, it does not trigger realm::Realm::close().

            if (stringGetBuffer != IntPtr.Zero)
            {
                Marshal.FreeHGlobal(stringGetBuffer);
                stringGetBuffer    = IntPtr.Zero;
                stringGetBufferLen = 0;
            }
        }