[nemiver] Make sure to never save empty sessions



commit 685b25b5f4f6c087f997bda9222549987a423969
Author: Dodji Seketeli <dodji redhat com>
Date:   Fri Mar 20 22:54:02 2009 +0100

    Make sure to never save empty sessions
    
    	* src/persp/dbgperspective/nmv-dbg-perspective.cc:
    	(DBGPerspective::record_and_save_new_session,
    	DBGPerspective::record_and_save_session): Don't save the
    	session if no program is being debugged.
---
 src/persp/dbgperspective/nmv-dbg-perspective.cc |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/src/persp/dbgperspective/nmv-dbg-perspective.cc b/src/persp/dbgperspective/nmv-dbg-perspective.cc
index 444f8c4..2089ff1 100644
--- a/src/persp/dbgperspective/nmv-dbg-perspective.cc
+++ b/src/persp/dbgperspective/nmv-dbg-perspective.cc
@@ -4041,6 +4041,10 @@ void
 DBGPerspective::record_and_save_new_session ()
 {
     THROW_IF_FAIL (m_priv);
+    if (m_priv->prog_path.empty ()) {
+        // Don't save emtpy sessions.
+        return;
+    }
     ISessMgr::Session session;
     record_and_save_session (session);
 }
@@ -4156,6 +4160,10 @@ void
 DBGPerspective::record_and_save_session (ISessMgr::Session &a_session)
 {
     THROW_IF_FAIL (m_priv);
+    if (m_priv->prog_path.empty ()) {
+        // Don't save empty sessions.
+        return;
+    }
     UString session_name = Glib::path_get_basename
         (Glib::filename_from_utf8 (m_priv->prog_path));
 



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