]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - c++/cursesapp.cc
ncurses 5.9 - patch 20141220
[ncurses.git] / c++ / cursesapp.cc
index 6871a69a39773d7af0ebd5dd799a8a2131a6ce00..ddab6fdf9b9dd182e4df8ddce9e0cf3d4c00b6bf 100644 (file)
@@ -1,6 +1,6 @@
 // * this is for making emacs happy: -*-Mode: C++;-*-
 /****************************************************************************
 // * this is for making emacs happy: -*-Mode: C++;-*-
 /****************************************************************************
- * Copyright (c) 1998-2003,2005 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
 
 /****************************************************************************
  *   Author: Juergen Pfeifer, 1997                                          *
 
 /****************************************************************************
  *   Author: Juergen Pfeifer, 1997                                          *
+ *      and: Thomas E. Dickey                                               *
  ****************************************************************************/
 
 #include "internal.h"
 #include "cursesapp.h"
 
  ****************************************************************************/
 
 #include "internal.h"
 #include "cursesapp.h"
 
-MODULE_ID("$Id: cursesapp.cc,v 1.13 2005/04/03 12:25:23 tom Exp $")
+MODULE_ID("$Id: cursesapp.cc,v 1.15 2008/08/16 17:15:35 tom Exp $")
 
 void
 NCursesApplication::init(bool bColors)
 
 void
 NCursesApplication::init(bool bColors)
@@ -72,11 +73,16 @@ NCursesApplication::~NCursesApplication()
   Soft_Label_Key_Set* S;
 
   delete titleWindow;
   Soft_Label_Key_Set* S;
 
   delete titleWindow;
+  titleWindow = 0;
+
   while( (S=top()) ) {
     pop();
     delete S;
   }
   while( (S=top()) ) {
     pop();
     delete S;
   }
+
   delete Root_Window;
   delete Root_Window;
+  Root_Window = 0;
+
   ::endwin();
 }
 
   ::endwin();
 }
 
@@ -103,8 +109,11 @@ bool NCursesApplication::pop()
     SLK_Link* L = slk_stack;
     slk_stack = slk_stack->prev;
     delete L;
     SLK_Link* L = slk_stack;
     slk_stack = slk_stack->prev;
     delete L;
-    if (Root_Window && top())
-      top()->show();
+    if (Root_Window) {
+      Soft_Label_Key_Set* xx = top();
+      if (xx != 0)
+        xx->show();
+    }
   }
   return (slk_stack ? FALSE : TRUE);
 }
   }
   return (slk_stack ? FALSE : TRUE);
 }