}
-static thread_specific Context *
+Context::~Context()
+{
+ //assert(this != getCurrentContext());
+ if (this != getCurrentContext()) {
+ delete wsContext;
+ }
+}
+
+
+static OS_THREAD_SPECIFIC_PTR(Context)
currentContextPtr;
return false;
}
- if (currentContext) {
- currentContext->drawable = NULL;
- }
+ currentContextPtr = context;
if (drawable && context) {
context->drawable = drawable;
- currentContextPtr = context;
if (!context->used) {
initContext();