Skip to content

Commit

Permalink
lib-lua: Remove script from linked list on destroy
Browse files Browse the repository at this point in the history
Otherwise it might cause a crash
  • Loading branch information
cmouse authored and sirainen committed Mar 12, 2018
1 parent 4002c09 commit d5614ea
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/lib-lua/dlua-script.c
Expand Up @@ -280,6 +280,9 @@ static void dlua_script_destroy(struct dlua_script *script)
lua_pop(script->L, 1);
}
lua_close(script->L);
/* remove from list */
DLLIST_REMOVE(&dlua_scripts, script);

/* then just release memory */
pool_unref(&script->pool);
}
Expand Down

0 comments on commit d5614ea

Please sign in to comment.