From 3258dd560549bedd5a5f774980d32c3c6cba46ca Mon Sep 17 00:00:00 2001 From: Neil Roberts Date: Thu, 20 Nov 2014 17:19:20 +0000 Subject: [PATCH] glx: Add implementation of __GLXContext->loseCurrent for direct ctxts Organization: Intel Corporation (UK) Ltd. - Co. Reg. #1134945 - Pipers Way, Swindon SN3 1RJ This adds a dummy implementation for the loseCurrent function in __GLXContext for direct contexts which just returns GL_TRUE. Without this then the X server can crash if receives a MakeCurrent message for a direct context because it will attempt to call loseCurrent when cleaning up the client in the callback for ClientStateGone. --- glx/glxcmds.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/glx/glxcmds.c b/glx/glxcmds.c index d11c667..dc20d8e 100644 --- a/glx/glxcmds.c +++ b/glx/glxcmds.c @@ -198,6 +198,12 @@ __glXdirectContextDestroy(__GLXcontext * context) free(context); } +static int +__glXdirectContextLoseCurrent(__GLXcontext * context) +{ + return GL_TRUE; +} + _X_HIDDEN __GLXcontext * __glXdirectContextCreate(__GLXscreen * screen, __GLXconfig * modes, __GLXcontext * shareContext) @@ -209,6 +215,7 @@ __glXdirectContextCreate(__GLXscreen * screen, return NULL; context->destroy = __glXdirectContextDestroy; + context->loseCurrent = __glXdirectContextLoseCurrent; return context; } -- 1.9.3