[nemiver] Cleanup from last commit to make close_file() less fragile



commit 75dc7847a7bc67e7003f15e40f660c99610e0e7e
Author: Jonathon Jongsma <jonathon jongsma collabora co uk>
Date:   Sun Apr 19 16:32:02 2009 -0500

    Cleanup from last commit to make close_file() less fragile
    
    	* src/persp/dbgperspective/nmv-dbg-perspective.cc: move the
    	update_file_maps() call to the end of the function so that we're not
    	susceptible to memory corruption no matter what string we pass to
    	this function, even though we've avoided the immediate problem by
    	copying the string before passing it to this function
---
 src/persp/dbgperspective/nmv-dbg-perspective.cc |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/persp/dbgperspective/nmv-dbg-perspective.cc b/src/persp/dbgperspective/nmv-dbg-perspective.cc
index 0f4026a..03362d0 100644
--- a/src/persp/dbgperspective/nmv-dbg-perspective.cc
+++ b/src/persp/dbgperspective/nmv-dbg-perspective.cc
@@ -4654,14 +4654,14 @@ DBGPerspective::close_file (const UString &a_path)
             << (int) (page_num)
             << ", path " << a_path);
     m_priv->sourceviews_notebook->remove_page (page_num);
-    update_file_maps ();
+    if (!do_unmonitor_file (a_path)) {
+        LOG_ERROR ("failed to unmonitor file " << a_path);
+    }
 
     if (!get_n_pages ()) {
         m_priv->opened_file_action_group->set_sensitive (false);
     }
-    if (!do_unmonitor_file (a_path)) {
-        LOG_ERROR ("failed to unmonitor file " << a_path);
-    }
+    update_file_maps ();
 }
 
 void



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]