window: Fix use-after-free in menu button handler
Commit d2fbb3870c introduced a use-after-free
error in the case where we destroy the menu.
This commit is contained in:
+2
-3
@@ -3363,11 +3363,10 @@ menu_button_handler(struct widget *widget,
|
|||||||
menu->current, menu->window->parent->user_data);
|
menu->current, menu->window->parent->user_data);
|
||||||
input_ungrab(input);
|
input_ungrab(input);
|
||||||
menu_destroy(menu);
|
menu_destroy(menu);
|
||||||
}
|
} else if (state == WL_POINTER_BUTTON_STATE_RELEASED) {
|
||||||
|
|
||||||
if (state == WL_POINTER_BUTTON_STATE_RELEASED)
|
|
||||||
menu->release_count++;
|
menu->release_count++;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
menu_redraw_handler(struct widget *widget, void *data)
|
menu_redraw_handler(struct widget *widget, void *data)
|
||||||
|
|||||||
Reference in New Issue
Block a user