As it is allowed by the CGL API.
{
}
- ~Context()
- {
- delete wsContext;
- }
+ ~Context();
glws::Context* wsContext;
Context *context = getContext(ctx);
if (context) {
- if (retrace::doubleBuffer) {
- context->drawable->swapBuffers();
+ if (context->drawable) {
+ if (retrace::doubleBuffer) {
+ context->drawable->swapBuffers();
+ } else {
+ glFlush();
+ }
+ frame_complete(call);
} else {
- glFlush();
+ if (retrace::debug) {
+ retrace::warning(call) << "context has no drawable\n";
+ }
}
-
- frame_complete(call);
}
}
}
+Context::~Context()
+{
+ //assert(this != getCurrentContext());
+ if (this != getCurrentContext()) {
+ delete wsContext;
+ }
+}
+
+
static thread_specific Context *
currentContextPtr;
return false;
}
- if (currentContext) {
- currentContext->drawable = NULL;
- }
currentContextPtr = context;
if (drawable && context) {