ekiga r7412 - trunk/lib/engine/framework
- From: jpuydt svn gnome org
- To: svn-commits-list gnome org
- Subject: ekiga r7412 - trunk/lib/engine/framework
- Date: Mon, 24 Nov 2008 08:55:55 +0000 (UTC)
Author: jpuydt
Date: Mon Nov 24 08:55:55 2008
New Revision: 7412
URL: http://svn.gnome.org/viewvc/ekiga?rev=7412&view=rev
Log:
Plugged leaks in Ekiga::RefLister
Modified:
trunk/lib/engine/framework/reflister.h
Modified: trunk/lib/engine/framework/reflister.h
==============================================================================
--- trunk/lib/engine/framework/reflister.h (original)
+++ trunk/lib/engine/framework/reflister.h Mon Nov 24 08:55:55 2008
@@ -82,7 +82,17 @@
template<typename ObjectType>
Ekiga::RefLister<ObjectType>::~RefLister ()
{
- objects.clear ();
+ for (typename container_type::iterator iter = objects.begin ();
+ iter != objects.end ();
+ ++iter) {
+
+ for (std::list<sigc::connection>::iterator conn_iter = iter->second.begin ();
+ conn_iter != iter->second.end ();
+ ++conn_iter) {
+
+ conn_iter->disconnect ();
+ }
+ }
}
template<typename ObjectType>
@@ -100,11 +110,8 @@
void
Ekiga::RefLister<ObjectType>::add_object (gmref_ptr<ObjectType> obj)
{
- std::list<sigc::connection> connections;
- connections.push_back (obj->updated.connect (sigc::bind (object_updated.make_slot (), obj)));
- connections.push_back (obj->removed.connect (sigc::bind (sigc::mem_fun (this, &Ekiga::RefLister<ObjectType>::remove_object), obj)));
-
- objects[obj] = connections;
+ objects[obj].push_back (obj->updated.connect (sigc::bind (object_updated.make_slot (), obj)));
+ objects[obj].push_back (obj->removed.connect (sigc::bind (sigc::mem_fun (this, &Ekiga::RefLister<ObjectType>::remove_object), obj)));
object_added.emit (obj);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]