From Colin McDonald and Robert Osfield, converted Traits::sharedContext from GraphicsContext* to osg:observer_ptr<GraphicsContext> to prevent dangling pointer issues.

This commit is contained in:
Robert Osfield
2012-09-05 21:03:41 +00:00
parent 63444f648f
commit 39dcea9ebb
19 changed files with 25 additions and 25 deletions

View File

@@ -399,7 +399,7 @@ bool GraphicsWindowCarbon::realizeImplementation()
// create the context
AGLContext sharedContextCarbon = NULL;
GraphicsHandleCarbon* graphicsHandleCarbon = dynamic_cast<GraphicsHandleCarbon*>(_traits->sharedContext);
GraphicsHandleCarbon* graphicsHandleCarbon = dynamic_cast<GraphicsHandleCarbon*>(_traits->sharedContext.get());
if (graphicsHandleCarbon)
{
sharedContextCarbon = graphicsHandleCarbon->getAGLContext();