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
Describe the bug
When an exception is thrown by FileStreamFactory.GetStream(...) after creating the FileStream, the stream becomes orphaned/unreachable, but is not disposed properly, holding an open handle to the file with no controlled or deterministic way to dispose of it.
This causes conflicts with other calls/processes which may want to manipulate this file after such an exception occurs.
Code to Reproduce
Write a small snippet to isolate your bug and could be possible to our team test. (REQUIRED)
/* given a pre-existing file.db protected with a password different than the one provided */
try {
var engineSettings = new EngineSettings { Filename = "file.db", Password="incorrectPassword", ReadOnly=ReadOnly }
var engine = new LiteEngine(engineSettings);
} catch {
File.Delete("file.db"); // Will throw access violation due to file already in use in another process.
}
Expected behavior
Disposable objects should always be disposed before going out of scope to ensure they aren't left dangling indefinitely or non-deterministically (until GC).
Screenshots/Stacktrace
Additional context
The text was updated successfully, but these errors were encountered:
Version
5.0.21
Describe the bug
When an exception is thrown by FileStreamFactory.GetStream(...) after creating the FileStream, the stream becomes orphaned/unreachable, but is not disposed properly, holding an open handle to the file with no controlled or deterministic way to dispose of it.
This causes conflicts with other calls/processes which may want to manipulate this file after such an exception occurs.
Code to Reproduce
Write a small snippet to isolate your bug and could be possible to our team test. (REQUIRED)
Expected behavior
Disposable objects should always be disposed before going out of scope to ensure they aren't left dangling indefinitely or non-deterministically (until GC).
Screenshots/Stacktrace
Additional context
The text was updated successfully, but these errors were encountered: