You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Environment.deinit always calls mdb_env_close(handle). However, if mdb_env_open fails on line 82, then the guard condition is entered and the handle is closed then an exception is thrown.
That exception might be caught higher up in such a way that the Environment is released and deinit is called, causing the handle to get released a second time and crashing.
In my case, the database failed to open because it did not have sufficient permissions for the target directory. The exception was caught and an error might be presented to the user, but since the Environment is released the application crashes.
Looks like it might be "safe" to just omit releasing the handle in the guard and instead relying on deinit as that seems to be the case for all other exceptions thrown in the initializer.
The text was updated successfully, but these errors were encountered:
Environment.deinit
always callsmdb_env_close(handle)
. However, ifmdb_env_open
fails on line 82, then theguard
condition is entered and the handle is closed then an exception is thrown.That exception might be caught higher up in such a way that the Environment is released and
deinit
is called, causing the handle to get released a second time and crashing.In my case, the database failed to open because it did not have sufficient permissions for the target directory. The exception was caught and an error might be presented to the user, but since the
Environment
is released the application crashes.Looks like it might be "safe" to just omit releasing the handle in the
guard
and instead relying ondeinit
as that seems to be the case for all other exceptions thrown in the initializer.The text was updated successfully, but these errors were encountered: