Changeset 12935
- Timestamp:
- 02/01/12 18:42:42 (16 months ago)
- Files:
-
- 1 modified
-
OpenSceneGraph/trunk/src/osg/GraphicsContext.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/src/osg/GraphicsContext.cpp
r12863 r12935 305 305 OpenThreads::ScopedLock<OpenThreads::Mutex> lock(s_contextIDMapMutex); 306 306 307 s_contextIDMap[contextID].incrementUsageCount(); 308 307 309 OSG_INFO<<"GraphicsContext::incrementContextIDUsageCount("<<contextID<<") to "<<s_contextIDMap[contextID]._numContexts<<std::endl; 308 309 s_contextIDMap[contextID].incrementUsageCount();310 310 } 311 311 … … 539 539 if (makeCurrent()) 540 540 { 541 542 OSG_INFO<<"Doing delete of GL objects"<<std::endl; 543 544 osg::deleteAllGLObjects(_state->getContextID()); 545 546 OSG_INFO<<"Done delete of GL objects"<<std::endl; 541 if ( !sharedContextExists ) 542 { 543 OSG_INFO<<"Doing delete of GL objects"<<std::endl; 544 545 osg::deleteAllGLObjects(_state->getContextID()); 546 547 OSG_INFO<<"Done delete of GL objects"<<std::endl; 548 } 549 else 550 { 551 // If the GL objects are shared with other contexts then only flush those 552 // which have already been deleted 553 554 osg::flushAllDeletedGLObjects(_state->getContextID()); 555 } 547 556 548 557 _state->reset(); … … 562 571 // the the flushDelete*() methods not being invoked, such as when using GraphicContextEmbedded where makeCurrent 563 572 // does not work. 564 if ( _state.valid())573 if ( !sharedContextExists && _state.valid()) 565 574 { 566 575 OSG_INFO<<"Doing discard of deleted OpenGL objects."<<std::endl;
