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
4. Y's destructor calls `Delete()` → `sqlite3session_delete(Y->session_)` (Y's session_ is still valid!)
102
102
5. Loop continues to Y → calls `sqlite3session_delete(Y)` again → **double-free → SIGABRT**
103
103
104
-
**Fix**: Split cleanup into two passes:
105
-
1. Pass 1: Delete all SQLite sessions and clear all `session_` pointers
106
-
2. Pass 2: Release database references (can trigger GC, but Delete() is now a no-op for all sessions)
104
+
**Fix**: Don't call `database_ref_.Reset()` in DeleteAllSessions() at all. The iteration loop only uses pure C/C++ operations (no Napi calls that could trigger GC), so it's safe. When Sessions are later GC'd, their `Delete()` returns early (session_ is nullptr) and Napi::ObjectReference destructor handles cleanup automatically.
0 commit comments