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()