Browse Source

Remove Context::init(). Instead, initialize application manually in the standalone launcher.

tags/v2.0.0
Andrew Belt 5 years ago
parent
commit
b0bde7453b
3 changed files with 11 additions and 15 deletions
  1. +0
    -2
      include/context.hpp
  2. +0
    -12
      src/context.cpp
  3. +11
    -1
      standalone/main.cpp

+ 0
- 2
include/context.hpp View File

@@ -38,8 +38,6 @@ struct Context {
history::State* history = NULL; history::State* history = NULL;
PatchManager* patch = NULL; PatchManager* patch = NULL;


/** Call this after setting the context for this thread, because initialization of application state accesses APP. */
void init();
~Context(); ~Context();
}; };




+ 0
- 12
src/context.cpp View File

@@ -10,18 +10,6 @@
namespace rack { 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() { 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
if (scene) if (scene)


+ 11
- 1
standalone/main.cpp View File

@@ -13,7 +13,9 @@
#include <app/Scene.hpp> #include <app/Scene.hpp>
#include <plugin.hpp> #include <plugin.hpp>
#include <context.hpp> #include <context.hpp>
#include <window.hpp>
#include <patch.hpp> #include <patch.hpp>
#include <history.hpp>
#include <ui.hpp> #include <ui.hpp>
#include <system.hpp> #include <system.hpp>
#include <string.hpp> #include <string.hpp>
@@ -174,7 +176,15 @@ int main(int argc, char* argv[]) {
// Initialize context // Initialize context
INFO("Initializing context"); INFO("Initializing context");
contextSet(new 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. // On Mac, use a hacked-in GLFW addition to get the launched path.
#if defined ARCH_MAC #if defined ARCH_MAC


Loading…
Cancel
Save