Small bug fix in zr_free_window

win->next can be zero and win->prev probably as well.
This commit is contained in:
richi 2016-01-17 16:42:29 +01:00
parent 5d1fdcdbe2
commit 52a936d98b
1 changed files with 4 additions and 2 deletions

View File

@ -6336,10 +6336,12 @@ zr_free_window(struct zr_context *ctx, struct zr_window *win)
if (win == ctx->begin) { if (win == ctx->begin) {
ctx->begin = win->next; ctx->begin = win->next;
ctx->begin->prev = 0; if (win->next)
ctx->begin->prev = 0;
} else if (win == ctx->end) { } else if (win == ctx->end) {
ctx->end = win->prev; ctx->end = win->prev;
ctx->end->next = 0; if (win->prev)
ctx->end->next = 0;
} else { } else {
if (win->next) if (win->next)
win->next->prev = win->next; win->next->prev = win->next;