pingus-cvs
[Top][All Lists]
Advanced

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

[Pingus-CVS] r3222 - trunk/pingus/src/input


From: jsalmon3
Subject: [Pingus-CVS] r3222 - trunk/pingus/src/input
Date: Sat, 22 Sep 2007 04:27:46 +0200

Author: jsalmon3
Date: 2007-09-22 04:27:40 +0200 (Sat, 22 Sep 2007)
New Revision: 3222

Modified:
   trunk/pingus/src/input/control.hpp
Log:
Fixed memory leaks

Modified: trunk/pingus/src/input/control.hpp
===================================================================
--- trunk/pingus/src/input/control.hpp  2007-09-22 02:19:00 UTC (rev 3221)
+++ trunk/pingus/src/input/control.hpp  2007-09-22 02:27:40 UTC (rev 3222)
@@ -98,6 +98,12 @@
     : Button(parent)
   {}
 
+  ~ButtonGroup()
+  {
+    for(std::vector<Button*>::iterator i = buttons.begin(); i != 
buttons.end(); ++i)
+      delete *i;
+  }
+
   void add_button(Button* button) {
     buttons.push_back(button);
   }
@@ -228,6 +234,12 @@
     : Axis(parent)
   {}
 
+  ~AxisGroup()
+  {
+    for(std::vector<Axis*>::iterator i = axes.begin(); i != axes.end(); ++i)
+      delete *i;
+  }
+
   void add_axis(Axis* axis) {
     axes.push_back(axis);
   }
@@ -280,6 +292,12 @@
     : Pointer(parent)
   {}
 
+  ~PointerGroup()
+  {
+    for(std::vector<Pointer*>::iterator i = pointer.begin(); i != 
pointer.end(); ++i)
+      delete *i;
+  }
+
   void update(Control* p) {
     Pointer* pointer = dynamic_cast<Pointer*>(p);
     assert(pointer);
@@ -329,6 +347,12 @@
     : Scroller(parent)
   {}
 
+  ~ScrollerGroup()
+  {
+    for(std::vector<Scroller*>::iterator i = scrollers.begin(); i != 
scrollers.end(); ++i)
+      delete *i;
+  }
+
   void update(float delta) {
     for(std::vector<Scroller*>::iterator i = scrollers.begin(); i != 
scrollers.end(); ++i)
       (*i)->update(delta);
@@ -388,6 +412,12 @@
     : Keyboard(parent)
   {}
 
+  ~KeyboardGroup()
+  {
+    for(std::vector<Keyboard*>::iterator i = keyboards.begin(); i != 
keyboards.end(); ++i)
+      delete *i;
+  }
+
   void update(float delta) {
   }
 





reply via email to

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