sqlite3.dart icon indicating copy to clipboard operation
sqlite3.dart copied to clipboard

Use finalizers to automatically dispose databases and statements

Open simolus3 opened this issue 3 years ago • 0 comments

In Dart 2.17, we can attach a Finalizer to objects to invoke a callback when they become unreachable. We can use this to automatically dispose databases and prepared statements if a user forgets to dispose them manually.

One issue is that the finalizer callback can't use the database itself, it would have to use a finalization token still providing all the information necessary to fully dispose the object.

simolus3 avatar May 11 '22 20:05 simolus3