Browse Source

Log initializing, creating, deleting, and destroying subsystems.

tags/v2.0.6
Andrew Belt 2 years ago
parent
commit
ba2bc099de
2 changed files with 28 additions and 4 deletions
  1. +22
    -4
      adapters/standalone.cpp
  2. +6
    -0
      src/context.cpp

+ 22
- 4
adapters/standalone.cpp View File

@@ -172,33 +172,45 @@ int main(int argc, char* argv[]) {
exit(1);
}

INFO("Initializing environment");
INFO("Initializing network");
network::init();
INFO("Initializing audio");
audio::init();
rtaudioInit();
INFO("Initializing MIDI");
midi::init();
rtmidiInit();
keyboard::init();
gamepad::init();
INFO("Initializing plugins");
plugin::init();
INFO("Initializing browser");
app::browserInit();
INFO("Initializing library");
library::init();
discord::init();
if (!settings::headless) {
INFO("Initializing UI");
ui::init();
INFO("Initializing window");
window::init();
}

// Initialize context
INFO("Initializing context");
contextSet(new Context);
INFO("Creating engine");
APP->engine = new engine::Engine;
INFO("Creating history state");
APP->history = new history::State;
INFO("Creating event state");
APP->event = new widget::EventState;
INFO("Creating scene");
APP->scene = new app::Scene;
APP->event->rootWidget = APP->scene;
INFO("Creating patch manager");
APP->patch = new patch::Manager;
if (!settings::headless) {
INFO("Creating window");
APP->window = new window::Window;
}

@@ -246,7 +258,7 @@ int main(int argc, char* argv[]) {
}

// Destroy context
INFO("Destroying context");
INFO("Deleting context");
delete APP;
contextSet(NULL);
if (!settings::headless) {
@@ -254,16 +266,22 @@ int main(int argc, char* argv[]) {
}

// Destroy environment
INFO("Destroying environment");
if (!settings::headless) {
INFO("Destroying window");
window::destroy();
INFO("Destroying UI");
ui::destroy();
}
discord::destroy();
INFO("Destroying library");
library::destroy();
INFO("Destroying MIDI");
midi::destroy();
INFO("Destroying audio");
audio::destroy();
INFO("Destroying plugins");
plugin::destroy();
INFO("Destroying network");
network::destroy();
INFO("Destroying logger");
logger::destroy();


+ 6
- 0
src/context.cpp View File

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

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

INFO("Deleting window");
delete window;
window = NULL;

INFO("Deleting patch manager");
delete patch;
patch = NULL;

INFO("Deleting scene");
delete scene;
scene = NULL;

INFO("Deleting event state");
delete event;
event = NULL;

INFO("Deleting history state");
delete history;
history = NULL;

INFO("Deleting engine");
delete engine;
engine = NULL;
}


Loading…
Cancel
Save