drift icon indicating copy to clipboard operation
drift copied to clipboard

Unclosed SQLite Tracker Database in DatabaseTracker

Open suojae opened this issue 10 months ago • 2 comments

https://github.com/simolus3/drift/blob/develop/drift/lib/src/sqlite3/database_tracker.dart

I noticed that the DatabaseTracker class currently lacks a dispose() method to explicitly close the _db resource. This could potentially lead to resource leaks, especially in long-running applications or during Flutter hot restarts.

Would it be okay if I worked on adding a dispose() method to ensure proper cleanup of the in-memory SQLite database and any related resources?

suojae avatar Jan 19 '25 07:01 suojae

Had to revert your merge, it was causing CI failures. https://github.com/simolus3/drift/actions/runs/12856287744/job/35842802925.

Weirdly enough I don't get those locally. Could you re-open the PR again? I'll have to find some time to investigate what's happening here.

simolus3 avatar Jan 19 '25 19:01 simolus3

Thanks. Since the original PR cannot be reopened due to being merged, I've created a new PR with the same changes for further investigation. Here's the link to the new PR.

Please let me know if there's anything else I should look into to help resolve the CI issue.

suojae avatar Jan 19 '25 19:01 suojae