Skip to content

Commit bc75829

Browse files
authored
Merge pull request #6 from bnoordhuis/fix-shutdown
Fix shutdown order / Remove dead code
2 parents e18482b + 27d5135 commit bc75829

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/sqlitejs.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,10 @@ static globaljs_context *globaljs_init (sqlite3 *db) {
205205
static void globaljs_free (globaljs_context *js) {
206206
if (!js) return;
207207

208-
if (js->runtime) JS_FreeRuntime(js->runtime);
208+
// order matters
209+
if (js->runtime) js_std_free_handlers(js->runtime);
209210
if (js->context) JS_FreeContext(js->context);
211+
if (js->runtime) JS_FreeRuntime(js->runtime);
210212
sqlite3_free(js);
211213
}
212214

0 commit comments

Comments
 (0)