[ruamoko] Unlink passage nodes when deleting

Fixes a segfault on shutdown after the memory leak changes.
This commit is contained in:
Bill Currie 2023-03-04 02:23:37 +09:00
parent be9e6893e5
commit 161ccc282f

View file

@ -84,6 +84,10 @@ passage_new (gui_resources_t *res)
static void
passage_free (gui_resources_t *res, rua_passage_t *passage)
{
if (passage->next) {
passage->next->prev = passage->prev;
}
*passage->prev = passage->next;
PR_RESFREE (res->passage_map, passage);
}
@ -192,8 +196,7 @@ bi_gui_clear (progs_t *pr, void *_res)
{
gui_resources_t *res = _res;
rua_passage_t *psg;
for (psg = res->passages; psg; psg = psg->next) {
for (rua_passage_t *psg = res->passages; psg; psg = psg->next) {
Passage_Delete (psg->passage);
}
res->passages = 0;