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); exit(1);
} }


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


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


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


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


// Destroy environment // Destroy environment
INFO("Destroying environment");
if (!settings::headless) { if (!settings::headless) {
INFO("Destroying window");
window::destroy(); window::destroy();
INFO("Destroying UI");
ui::destroy(); ui::destroy();
} }
discord::destroy(); discord::destroy();
INFO("Destroying library");
library::destroy(); library::destroy();
INFO("Destroying MIDI");
midi::destroy(); midi::destroy();
INFO("Destroying audio");
audio::destroy(); audio::destroy();
INFO("Destroying plugins");
plugin::destroy(); plugin::destroy();
INFO("Destroying network");
network::destroy(); network::destroy();
INFO("Destroying logger"); INFO("Destroying logger");
logger::destroy(); 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 // Set pointers to NULL so other objects will segfault when attempting to access them


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


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


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


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


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


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


Loading…
Cancel
Save