static void retrace_CGLFlushDrawable(trace::Call &call) {
- if (currentDrawable && currentContext) {
+ unsigned long long ctx = call.arg(0).toUIntPtr();
+ Context *context = getContext(ctx);
+
+ if (context) {
if (retrace::doubleBuffer) {
- currentDrawable->swapBuffers();
+ context->drawable->swapBuffers();
} else {
glFlush();
}