summaryrefslogtreecommitdiff
path: root/src/editor/editor.cpp
diff options
context:
space:
mode:
authorkasull <qsullian@gmail.com>2026-03-03 18:49:43 -0500
committerkasull <qsullian@gmail.com>2026-03-03 18:49:43 -0500
commitbe91342733fd56d1e7bafe72e82a8ac4dc67b79d (patch)
tree0b87d812dd90b54df35279b06a7beca9de84c965 /src/editor/editor.cpp
parent5c4e9c8b140b14ba9671b8efcc47d71c6c4f2217 (diff)
fix use after freeui-rework
Diffstat (limited to 'src/editor/editor.cpp')
-rw-r--r--src/editor/editor.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/editor/editor.cpp b/src/editor/editor.cpp
index 63360d1..3873913 100644
--- a/src/editor/editor.cpp
+++ b/src/editor/editor.cpp
@@ -4,6 +4,31 @@
GAME_EDITOR* editor = 0;
+void editor_clear_gui_state_refs( GAME_EDITOR* e ) {
+ if( !e )
+ return;
+
+ e->gui.new_map_popup = 0;
+
+ e->gui.v2d = 0;
+ e->gui.v3d = 0;
+ e->gui.gridlabel = 0;
+ e->gui.props = 0;
+ e->gui.tool = 0;
+
+ e->gui.assets = 0;
+ e->gui.status = 0;
+ e->gui.assets_scroll = 0;
+
+ e->gui.header_toolbar = 0;
+ e->gui.header_viewtype_label = 0;
+ e->gui.header_back = 0;
+ e->gui.header_mode_2d = 0;
+ e->gui.header_mode_3d = 0;
+ e->gui.header_mode_sim = 0;
+ e->gui.header_viewtype = 0;
+}
+
static void editor_push_undo_action( GAME_EDITOR* e, const GAME_EDITOR::EDITOR_UNDO_ACTION& action ) {
if( !e )
return;
@@ -410,6 +435,7 @@ STAT editor_close( GAME_EDITOR* e ) {
I32 w = e->wnd->w, h = e->wnd->h;
gui_free( e->wnd );
+ editor_clear_gui_state_refs( e );
e->wnd = gui_editorwindow( w, h );
} );