fixed list window list removing

This commit is contained in:
vurtun
2016-01-16 21:30:56 +01:00
parent a8ea26e9f4
commit 02a8a682db
+14 -9
View File
@@ -6307,20 +6307,24 @@ zr_free_window(struct zr_context *ctx, struct zr_window *win)
{
/* unlink windows from list */
struct zr_table *n, *it = win->tables;
if (win->next)
win->next->prev = win->next;
if (win->prev)
win->prev->next = win->next;
if (win == ctx->begin) {
ctx->begin = win->next;
ctx->begin->prev = 0;
} else if (win == ctx->end) {
ctx->end = win->prev;
ctx->end->next = 0;
} else {
if (win->next)
win->next->prev = win->next;
if (win->prev)
win->prev->next = win->prev;
}
if (win->popup.win) {
zr_free_window(ctx, win->popup.win);
win->popup.win = 0;
}
if (win == ctx->begin)
ctx->begin = win->next;
if (win == ctx->end)
ctx->end = win->prev;
win->next = 0;
win->prev = 0;
@@ -6652,6 +6656,7 @@ zr_clear(struct zr_context *ctx)
if (iter->seq != ctx->seq) {
next = iter->next;
zr_free_window(ctx, iter);
ctx->count--;
iter = next;
} else iter = iter->next;
}