[network-manager-applet/NETWORKMANAGER_APPLET_0_7] editor: fix memory scribbling when cleaning up size group
- From: Dan Williams <dcbw src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [network-manager-applet/NETWORKMANAGER_APPLET_0_7] editor: fix memory scribbling when cleaning up size group
- Date: Thu, 17 Sep 2009 18:17:18 +0000 (UTC)
commit ca4c1218bdada02f3f1c216086266ada59ebfea3
Author: Dan Williams <dcbw redhat com>
Date: Thu Sep 17 10:50:38 2009 -0700
editor: fix memory scribbling when cleaning up size group
The list returned by gtk_size_group_get_widgets() isn't valid
after add/remove operations like gtk_size_group_remove_widget(),
so we just remove the first child until all children are gone.
src/wireless-dialog.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/src/wireless-dialog.c b/src/wireless-dialog.c
index 9969c07..a5cb51f 100644
--- a/src/wireless-dialog.c
+++ b/src/wireless-dialog.c
@@ -125,14 +125,15 @@ model_free (GtkTreeModel *model, guint col)
static void
size_group_clear (GtkSizeGroup *group)
{
- GSList *children;
GSList *iter;
g_return_if_fail (group != NULL);
- children = gtk_size_group_get_widgets (group);
- for (iter = children; iter; iter = g_slist_next (iter))
+ iter = gtk_size_group_get_widgets (group);
+ while (iter) {
gtk_size_group_remove_widget (group, GTK_WIDGET (iter->data));
+ iter = gtk_size_group_get_widgets (group);
+ }
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]