From 4d09574ccdba4c5664eef31edb3587b1d7807758 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 30 May 2011 09:25:11 +0000 Subject: [PATCH] Fixed X11 related crash that occured when GraphicsWindow::setCursor was called right after viewer.realize(); The fix was to simply move the setting of the thread that has done the makeCurrent to right before the makeCurrent() rather than right after. --- src/osg/GraphicsContext.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/osg/GraphicsContext.cpp b/src/osg/GraphicsContext.cpp index cd06b69e4..73350e91e 100644 --- a/src/osg/GraphicsContext.cpp +++ b/src/osg/GraphicsContext.cpp @@ -579,12 +579,12 @@ void GraphicsContext::close(bool callCloseImplementation) bool GraphicsContext::makeCurrent() { + _threadOfLastMakeCurrent = OpenThreads::Thread::CurrentThread(); + bool result = makeCurrentImplementation(); if (result) { - _threadOfLastMakeCurrent = OpenThreads::Thread::CurrentThread(); - // initialize extension process, not only initializes on first // call, will be a non-op on subsequent calls. getState()->initializeExtensionProcs();