}
retrace::warning(call) << "Failed to create " << name << " context.\n";
- os::abort();
+ exit(1);
}
context_map[orig_context] = context;
it = context_map.find(orig_context);
if (it != context_map.end()) {
- delete it->second;
+ glretrace::Context *currentContext = glretrace::getCurrentContext();
+ if (it->second != currentContext) {
+ // TODO: reference count
+ delete it->second;
+ }
context_map.erase(it);
}
}