diff --git a/include/context.hpp b/include/context.hpp index 85d15a55..442c672e 100644 --- a/include/context.hpp +++ b/include/context.hpp @@ -38,8 +38,6 @@ struct Context { history::State* history = NULL; PatchManager* patch = NULL; - /** Call this after setting the context for this thread, because initialization of application state accesses APP. */ - void init(); ~Context(); }; diff --git a/src/context.cpp b/src/context.cpp index 26f48217..842bb43a 100644 --- a/src/context.cpp +++ b/src/context.cpp @@ -10,18 +10,6 @@ namespace rack { -void Context::init() { - engine = new engine::Engine; - patch = new PatchManager; - if (!settings::headless) { - event = new event::State; - history = new history::State; - window = new Window; - scene = new app::Scene; - event->rootWidget = scene; - } -} - Context::~Context() { // Set pointers to NULL so other objects will segfault when attempting to access them if (scene) diff --git a/standalone/main.cpp b/standalone/main.cpp index 9cab2dc3..fa57c878 100644 --- a/standalone/main.cpp +++ b/standalone/main.cpp @@ -13,7 +13,9 @@ #include #include #include +#include #include +#include #include #include #include @@ -174,7 +176,15 @@ int main(int argc, char* argv[]) { // Initialize context INFO("Initializing context"); contextSet(new Context); - APP->init(); + APP->engine = new engine::Engine; + APP->patch = new PatchManager; + if (!settings::headless) { + APP->event = new event::State; + APP->history = new history::State; + APP->window = new Window; + APP->scene = new app::Scene; + APP->event->rootWidget = APP->scene; + } // On Mac, use a hacked-in GLFW addition to get the launched path. #if defined ARCH_MAC