Skip to content

Commit 8c2dead

Browse files
committed
Fix for Issue #49 : do not unload the fdb_c.dll
- unloading the native library could happen before all native callbacks have fired
1 parent b86c680 commit 8c2dead

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

FoundationDB.Client/Native/UnmanagedLibrary.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ public sealed class SafeLibraryHandle : FdbSafeHandle
4949

5050
protected override void Destroy(IntPtr handle)
5151
{
52-
NativeMethods.FreeLibrary(handle);
52+
//cf Issue #49: it is too dangerous to unload the library because callbacks could still fire from the native side
53+
//DISABLED: NativeMethods.FreeLibrary(handle);
5354
}
5455
}
5556
#else
@@ -60,7 +61,9 @@ private SafeLibraryHandle() : base(true) { }
6061

6162
protected override bool ReleaseHandle()
6263
{
63-
return NativeMethods.FreeLibrary(handle);
64+
//cf Issue #49: it is too dangerous to unload the library because callbacks could still fire from the native side
65+
//DISABLED: return NativeMethods.FreeLibrary(handle);
66+
return true;
6467
}
6568
}
6669
#endif

0 commit comments

Comments
 (0)