From 7f275b6f6e6193db803369da73fc02a39d1f54ef Mon Sep 17 00:00:00 2001 From: GhostofCookie Date: Thu, 23 Jan 2025 14:58:54 -0500 Subject: [PATCH] Check if editor context is being used before destroying window. --- src/windows/GraphWindow.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/windows/GraphWindow.cpp b/src/windows/GraphWindow.cpp index 72a80fd..329d309 100644 --- a/src/windows/GraphWindow.cpp +++ b/src/windows/GraphWindow.cpp @@ -301,7 +301,13 @@ GraphWindow::~GraphWindow() _links.clear(); + if (ed::GetCurrentEditor() == std::bit_cast(_editor_ctx.get())) + { + ed::SetCurrentEditor(nullptr); + } + ed::DestroyEditor(std::bit_cast(_editor_ctx.get())); + _editor_ctx.reset(); } void GraphWindow::SetCurrentGraph()