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

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;
}


+ 5
- 5
standalone/main.cpp View File

@@ -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


Loading…
Cancel
Save