Browse Source

Reorder initialization and destruction of submodules.

tags/v2.0.0
Andrew Belt 3 years ago
parent
commit
66cb723b63
2 changed files with 11 additions and 11 deletions
  1. +6
    -6
      src/context.cpp
  2. +5
    -5
      standalone/main.cpp

+ 6
- 6
src/context.cpp View File

@@ -15,21 +15,21 @@ Context::~Context() {


// Set pointers to NULL so other objects will segfault when attempting to access them // Set pointers to NULL so other objects will segfault when attempting to access them


delete patch;
patch = NULL;

delete scene;
scene = NULL;

delete window; delete window;
window = NULL; window = NULL;


delete patch;
patch = NULL;

delete history; delete history;
history = NULL; history = NULL;


delete event; delete event;
event = NULL; event = NULL;


delete scene;
scene = NULL;

delete engine; delete engine;
engine = NULL; engine = NULL;
} }


+ 5
- 5
standalone/main.cpp View File

@@ -182,14 +182,14 @@ int main(int argc, char* argv[]) {
INFO("Initializing context"); INFO("Initializing context");
contextSet(new Context); contextSet(new Context);
APP->engine = new engine::Engine; 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) { if (!settings::headless) {
APP->event = new widget::EventState;
APP->history = new history::State;
APP->window = new Window; 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. // On Mac, use a hacked-in GLFW addition to get the launched path.
#if defined ARCH_MAC #if defined ARCH_MAC


Loading…
Cancel
Save