From Robert Milharcic, "This will hopefully fix some issues with osgQt, more precisely with GLWidget event handling. There are at least two current GL context braking events, QEvent::Hide and QEvent::ParentChange. When running in a multithreaded mode they both try to change current GL context in a wrong thread (main GUI thread). The QEvent::ParentChange is also problematic when running in a single threaded model because Qt is going to release current contex then delete it, and then it will create new one, and as a result the osg will continue to render to an invalid deleted context. This changes workaround above problems by deferring execution of the problematic evens. These events has to be enqueued and executed later. The enqueued event processing is currently done right after swap in a swapBuffersImplementation of GraphicsWindowQt while code is running in a render thread by calling QGLWidget handler directly. In principle the deferred events queue should be executed while in GUI thread but I couldn't find any reliable way to do this, that is without risking a deadlock. For now it is assumed, Qt is not going to execute any GUI thread only operations inside the QGLWidget handler."
This commit is contained in:
@@ -261,7 +261,7 @@ class OSG_EXPORT GraphicsContext : public Object
|
||||
void removeAllOperations();
|
||||
|
||||
/** Run the operations. */
|
||||
void runOperations();
|
||||
virtual void runOperations();
|
||||
|
||||
typedef std::list< ref_ptr<Operation> > GraphicsOperationQueue;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user