ericsink / SQLitePCL.raw

A Portable Class Library (PCL) for low-level (raw) access to SQLite
Apache License 2.0
512 stars 106 forks source link

Remove hook_handle.ForDispose ? #406

Open ericsink opened 3 years ago

ericsink commented 3 years ago

@sebastienros That's a separate issue. hook_handle.ForDispose() prevents instances created to represent null from getting disposed. The solution is to delete hook_handle.ForDispose() since it's unnecessary (disposing of a null/invalid SafeHandle is not only fine; it's expected).

Originally posted by @sharwell in https://github.com/ericsink/SQLitePCL.raw/issues/398#issuecomment-787583885

sebastienros commented 3 years ago

Adding rationale: A trace shows that some hook_handle instances are not disposed correctly and induce a Finalize() call from the GC.