From d1ea4b3570143bc83e98b05117898d715554e681 Mon Sep 17 00:00:00 2001 From: Josh Yelon Date: Thu, 9 Mar 2006 23:08:30 +0000 Subject: [PATCH] Fixed bug in prepare_for_deletion --- panda/src/display/graphicsOutput.cxx | 39 +++++++++++----------------- 1 file changed, 15 insertions(+), 24 deletions(-) diff --git a/panda/src/display/graphicsOutput.cxx b/panda/src/display/graphicsOutput.cxx index c5f93766b3..f5822789ca 100644 --- a/panda/src/display/graphicsOutput.cxx +++ b/panda/src/display/graphicsOutput.cxx @@ -1002,31 +1002,22 @@ end_frame(FrameMode mode) { void GraphicsOutput:: prepare_for_deletion() { - // I'll remove this permanently in a few days. - Josh - // HOWEVER - it might be nice to add this functionality to the - // new module. It's not in there yet. + _active = false; + _delete_flag = true; + + // We have to be sure to remove all of the display regions + // immediately, so that circular reference counts can be cleared + // up (each display region keeps a pointer to a CullResult, + // which can hold all sorts of pointers). + remove_all_display_regions(); - // But when show-buffers mode is enabled, we want to keep the - // window around until the user has a chance to see the texture. - // So we don't do most of the following in show-buffers mode. - // if (!show_buffers) { - // _active = false; - // _delete_flag = true; - // - // // We have to be sure to remove all of the display regions - // // immediately, so that circular reference counts can be cleared - // // up (each display region keeps a pointer to a CullResult, - // // which can hold all sorts of pointers). - // remove_all_display_regions(); - // - // // If we were rendering directly to texture, we can't delete the - // // buffer until the texture is gone too. - // for (int i=0; i