Browse Source

Remove contextInit() and contextDestroy() since they don't really make sense with multiple instances.

tags/v2.0.0
Andrew Belt 5 years ago
parent
commit
529d87ee12
2 changed files with 4 additions and 14 deletions
  1. +0
    -12
      src/context.cpp
  2. +4
    -2
      src/main.cpp

+ 0
- 12
src/context.cpp View File

@@ -47,18 +47,6 @@ Context::~Context() {


static thread_local Context* context = NULL; static thread_local Context* context = NULL;


void contextInit() {
assert(!context);
context = new Context;
context->init();
}

void contextDestroy() {
assert(context);
delete context;
context = NULL;
}

Context* contextGet() { Context* contextGet() {
assert(context); assert(context);
return context; return context;


+ 4
- 2
src/main.cpp View File

@@ -173,7 +173,8 @@ int main(int argc, char* argv[]) {


// Initialize context // Initialize context
INFO("Initializing context"); INFO("Initializing context");
contextInit();
contextSet(new Context);
APP->init();


// 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
@@ -221,7 +222,8 @@ int main(int argc, char* argv[]) {
settings::patchPath = APP->patch->path; settings::patchPath = APP->patch->path;
} }
INFO("Destroying context"); INFO("Destroying context");
contextDestroy();
delete APP;
contextSet(NULL);
if (!settings::headless) { if (!settings::headless) {
settings::save(asset::settingsPath); settings::save(asset::settingsPath);
} }


Loading…
Cancel
Save