Author: lupus
Date: 2007-06-18 13:24:54 -0400 (Mon, 18 Jun 2007)
New Revision: 80028

Modified:
   trunk/moon/src/ChangeLog
   trunk/moon/src/runtime.cpp
Log:


Mon Jun 18 19:35:56 CEST 2007 Paolo Molaro <[EMAIL PROTECTED]>

        * runtime.cpp: properly remove items from the doubly-linked list.



Modified: trunk/moon/src/ChangeLog
===================================================================
--- trunk/moon/src/ChangeLog    2007-06-18 17:24:46 UTC (rev 80027)
+++ trunk/moon/src/ChangeLog    2007-06-18 17:24:54 UTC (rev 80028)
@@ -1,3 +1,8 @@
+
+Mon Jun 18 19:35:56 CEST 2007 Paolo Molaro <[EMAIL PROTECTED]>
+
+       * runtime.cpp: properly remove items from the doubly-linked list.
+
 2007-06-18  Chris Toshok  <[EMAIL PROTECTED]>
 
        * animation.cpp (AnimationStorage::~AnimationStorage): delete the

Modified: trunk/moon/src/runtime.cpp
===================================================================
--- trunk/moon/src/runtime.cpp  2007-06-18 17:24:46 UTC (rev 80027)
+++ trunk/moon/src/runtime.cpp  2007-06-18 17:24:54 UTC (rev 80028)
@@ -110,26 +110,26 @@
 void
 Collection::Remove (DependencyObject *data)
 {
-       GList *l, *prev = NULL;
        bool found = FALSE;
 
        // Do this by hand, so we only unref if we find the object
        for (GList *l = list; l != NULL; l = l->next){
                if (l->data == data){
                        found = TRUE;
-                       if (prev)
-                               prev->next = l->next;
-                       else
+                       if (l->prev)
+                               l->prev->next = l->next;
+                       if (l->next)
+                               l->next->prev = l->prev;
+                       if (list == l)
                                list = l->next;
                        g_list_free_1 (l);
                        break;
                }
-               prev = l;
        }
        data->SetParent (NULL);
+       data->Detach (NULL, this);
        if (found)
                data->unref ();
-       data->Detach (NULL, this);
 }
 
 Collection::~Collection ()

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to