adonthell-commits
[Top][All Lists]
Advanced

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

[Adonthell-commits] CVS: adonthell/src dialog.cc,1.32,1.33 win_base.cc,1


From: Kai Sterker <address@hidden>
Subject: [Adonthell-commits] CVS: adonthell/src dialog.cc,1.32,1.33 win_base.cc,1.2,1.3 win_base.h,1.22,1.23 win_manager.cc,1.10,1.11
Date: Sun, 29 Sep 2002 12:08:36 -0400

Update of /cvsroot/adonthell/adonthell/src
In directory subversions:/tmp/cvs-serv5454

Modified Files:
        dialog.cc win_base.cc win_base.h win_manager.cc 
Log Message:
FIXED memleak in dialog.cc
ADDED automatic removal of windows from win_manager on deletion


Index: dialog.cc
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/dialog.cc,v
retrieving revision 1.32
retrieving revision 1.33
diff -C2 -r1.32 -r1.33
*** dialog.cc   20 Aug 2002 17:40:40 -0000      1.32
--- dialog.cc   29 Sep 2002 16:08:34 -0000      1.33
***************
*** 362,365 ****
--- 362,366 ----
          Py_XDECREF (result);
          delete[] str;
+         delete[] tmp;
      }
  

Index: win_base.cc
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/win_base.cc,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** win_base.cc 28 Jul 2001 20:34:49 -0000      1.2
--- win_base.cc 29 Sep 2002 16:08:34 -0000      1.3
***************
*** 15,22 ****
--- 15,25 ----
  
  #include "win_base.h"
+ #include "win_manager.h"
  #include "win_container.h"
  
  win_base::win_base(): win_border(this),win_background(this)
  {
+   manager_ = NULL;
+   
    wb_father_= NULL;
    
***************
*** 42,45 ****
--- 45,50 ----
  win_base::~win_base()
  {
+     if (manager_) manager_->remove (this);
+     manager_ = NULL;
  }
  
***************
*** 128,133 ****
  }
  
! 
! 
  
  
--- 133,140 ----
  }
  
! void win_base::set_manager (win_manager *m)
! {
!     manager_ = m;
! }
  
  

Index: win_base.h
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/win_base.h,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -r1.22 -r1.23
*** win_base.h  2 Sep 2001 12:56:37 -0000       1.22
--- win_base.h  29 Sep 2002 16:08:34 -0000      1.23
***************
*** 38,42 ****
  class win_scroll;
  class win_select;
! 
  
  /**
--- 38,42 ----
  class win_scroll;
  class win_select;
! class win_manager;
  
  /**
***************
*** 245,249 ****
  
    virtual ~win_base();
!   
    static const u_int8 ALIGN_NONE = 0;
    static const u_int8 ALIGN_LEFT = 1;
--- 245,251 ----
  
    virtual ~win_base();
! 
!   void set_manager (win_manager*);
!     
    static const u_int8 ALIGN_NONE = 0;
    static const u_int8 ALIGN_LEFT = 1;
***************
*** 291,294 ****
--- 293,297 ----
    win_container * wb_father_;
    
+   win_manager * manager_;
  };
  

Index: win_manager.cc
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/win_manager.cc,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -r1.10 -r1.11
*** win_manager.cc      5 Nov 2001 21:17:33 -0000       1.10
--- win_manager.cc      29 Sep 2002 16:08:34 -0000      1.11
***************
*** 53,56 ****
--- 53,58 ----
  win_manager::~win_manager ()
  {
+     destroy ();
+     
      // restore parent window(s)
      active = prev;
***************
*** 63,68 ****
      
      for (i = wnd_list.begin(); i != wnd_list.end(); i++)
!         delete *i;
!   
      wnd_list.clear ();
      wnd_focus = NULL;
--- 65,73 ----
      
      for (i = wnd_list.begin(); i != wnd_list.end(); i++)
!     {
!         (*i)->set_manager (NULL);
!         // delete *i;
!     }
!     
      wnd_list.clear ();
      wnd_focus = NULL;
***************
*** 93,96 ****
--- 98,102 ----
  {
      wnd_list.push_back (tmp);
+     tmp->set_manager (this);
  }
  
***************
*** 127,130 ****
--- 133,137 ----
      // remove it from the window list
      wnd_list.remove (tmp);
+     tmp->set_manager (NULL);
      
      // if no window has the focus, give it to the topmost window
***************
*** 166,170 ****
  }
  
! // give the focus to a window 
  void win_manager::set_focus (win_base *tmp)
  {
--- 173,177 ----
  }
  
! // give the focus to a window
  void win_manager::set_focus (win_base *tmp)
  {





reply via email to

[Prev in Thread] Current Thread [Next in Thread]