Date: Tuesday, December 5, 2006 @ 16:18:40
  Author: gilles
    Path: /cvsroot/carob/carob

Modified: include/WatchedControllers.hpp (1.2 -> 1.3)
          src/WatchedControllers.cpp (1.2 -> 1.3)

Fixed memory leak by adding clean-up of the callback


--------------------------------+
 include/WatchedControllers.hpp |    5 +++++
 src/WatchedControllers.cpp     |    7 ++++++-
 2 files changed, 11 insertions(+), 1 deletion(-)


Index: carob/include/WatchedControllers.hpp
diff -u carob/include/WatchedControllers.hpp:1.2 
carob/include/WatchedControllers.hpp:1.3
--- carob/include/WatchedControllers.hpp:1.2    Thu Nov 30 21:10:28 2006
+++ carob/include/WatchedControllers.hpp        Tue Dec  5 16:18:40 2006
@@ -87,6 +87,11 @@
       int controllerTimeout, ControllerStateChangedCallback* cbPtr);
 
   /**
+   * Deletes the callback
+   */
+  ~WatchedControllers();
+
+  /**
    * Adds a controller to the list and associates the given lastTimeSeenValue 
to
    * it. Note that this operation is thread-safe, thus can slow-down other
    * concurrent operations like [EMAIL PROTECTED] #removeController(const 
ControllerInfo&)},
Index: carob/src/WatchedControllers.cpp
diff -u carob/src/WatchedControllers.cpp:1.2 
carob/src/WatchedControllers.cpp:1.3
--- carob/src/WatchedControllers.cpp:1.2        Thu Nov 30 21:10:28 2006
+++ carob/src/WatchedControllers.cpp    Tue Dec  5 16:18:40 2006
@@ -68,7 +68,12 @@
     this->controllers[*iter].updateTime(initTime);
   }
 }
-  
+
+WatchedControllers::~WatchedControllers()
+{
+  delete callback_ptr;
+}
+
 void WatchedControllers::addController(const ControllerInfo& ctrl, long 
lastTimeSeen)
 {
   LockScope ls(&controllers_CS);

_______________________________________________
Carob-commits mailing list
[email protected]
https://forge.continuent.org/mailman/listinfo/carob-commits

Reply via email to