mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 02:15:43 -04:00
Fix another GL crash at shutdown
This commit is contained in:
parent
90f05d7284
commit
f9add18798
@ -3008,15 +3008,8 @@ close_gsg() {
|
||||
// will be responsible for cleaning up anything we don't clean up
|
||||
// explicitly. We'll just let them drop.
|
||||
|
||||
// However, if any objects have recently been released, we have to
|
||||
// ensure they are actually deleted properly.
|
||||
Thread *current_thread = Thread::get_current_thread();
|
||||
_prepared_objects->begin_frame(this, current_thread);
|
||||
_prepared_objects->end_frame(current_thread);
|
||||
|
||||
// We have to clear the list of timer queries, though, otherwise
|
||||
// their destructors will cause a crash when they try to access
|
||||
// the GSG object.
|
||||
// Make sure that all the contexts belonging to the GSG are deleted.
|
||||
_prepared_objects.clear();
|
||||
#ifdef DO_PSTATS
|
||||
_pending_timer_queries.clear();
|
||||
#endif
|
||||
|
@ -4689,6 +4689,13 @@ void CLP(GraphicsStateGuardian)::
|
||||
release_texture(TextureContext *tc) {
|
||||
CLP(TextureContext) *gtc = DCAST(CLP(TextureContext), tc);
|
||||
|
||||
#ifndef OPENGLES
|
||||
_textures_needing_fetch_barrier.erase(gtc);
|
||||
_textures_needing_image_access_barrier.erase(gtc);
|
||||
_textures_needing_update_barrier.erase(gtc);
|
||||
_textures_needing_framebuffer_barrier.erase(gtc);
|
||||
#endif
|
||||
|
||||
glDeleteTextures(1, >c->_index);
|
||||
|
||||
if (gtc->_buffer != 0) {
|
||||
|
@ -23,15 +23,6 @@ TypeHandle CLP(TextureContext)::_type_handle;
|
||||
////////////////////////////////////////////////////////////////////
|
||||
CLP(TextureContext)::
|
||||
~CLP(TextureContext)() {
|
||||
#ifndef OPENGLES
|
||||
if (gl_enable_memory_barriers) {
|
||||
_glgsg->_textures_needing_fetch_barrier.erase(this);
|
||||
_glgsg->_textures_needing_image_access_barrier.erase(this);
|
||||
_glgsg->_textures_needing_update_barrier.erase(this);
|
||||
_glgsg->_textures_needing_framebuffer_barrier.erase(this);
|
||||
}
|
||||
#endif
|
||||
|
||||
// Don't call glDeleteTextures; we may not have an active context.
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user