Fix #125006: crash confirming specific operator popup dialog with ENTER #125085

Merged
Philipp Oeser merged 1 commits from lichtwerk/blender:125006 into main 2024-07-22 11:43:24 +02:00

1 Commits

Author SHA1 Message Date
76ef84516f Fix #125006: crash confirming specific operator popup dialog with ENTER
Crash was happening in this scenario:
- mouse was over a property in the dialog
- operator had a "check" callback that was accessing certain operator
stuff

In this case, the `UI_BUT_ACTIVE_DEFAULT` button was executed, operator
finished or canceled (but stuff was freed along the way), then code
kicked in to still handle ENTER over the property in the popup (e.g.
toggle a checkbox), the `uiAfterFunc` still had the `popup_op`, tried to
run `popup_check` again with the faulty data.

Simple way to fix this is to use `WM_UI_HANDLER_BREAK` to not handle
further buttons after executing the `UI_BUT_ACTIVE_DEFAULT`
2024-07-19 16:49:10 +02:00