From 66cb723b63a0cdcaa347309b6be08b4de5db51e4 Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Tue, 16 Feb 2021 18:01:15 -0500 Subject: [PATCH] Reorder initialization and destruction of submodules. --- src/context.cpp | 12 ++++++------ standalone/main.cpp | 10 +++++----- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/context.cpp b/src/context.cpp index 76bb7f47..608d771c 100644 --- a/src/context.cpp +++ b/src/context.cpp @@ -15,21 +15,21 @@ Context::~Context() { // Set pointers to NULL so other objects will segfault when attempting to access them - delete patch; - patch = NULL; - - delete scene; - scene = NULL; - delete window; window = NULL; + delete patch; + patch = NULL; + delete history; history = NULL; delete event; event = NULL; + delete scene; + scene = NULL; + delete engine; engine = NULL; } diff --git a/standalone/main.cpp b/standalone/main.cpp index c2f640b5..b7c27be9 100644 --- a/standalone/main.cpp +++ b/standalone/main.cpp @@ -182,14 +182,14 @@ int main(int argc, char* argv[]) { INFO("Initializing context"); contextSet(new Context); APP->engine = new engine::Engine; + APP->history = new history::State; + APP->event = new widget::EventState; + APP->scene = new app::Scene; + APP->event->rootWidget = APP->scene; + APP->patch = new PatchManager; if (!settings::headless) { - APP->event = new widget::EventState; - APP->history = new history::State; APP->window = new Window; - APP->scene = new app::Scene; - APP->event->rootWidget = APP->scene; } - APP->patch = new PatchManager; // On Mac, use a hacked-in GLFW addition to get the launched path. #if defined ARCH_MAC