From 1438596e5d9d32c62666ab0aec1ef815ff22aad9 Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Fri, 5 Sep 2008 16:59:23 +0000 Subject: [PATCH] fix memory leak git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@55481 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/button.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/gtk/button.cpp b/src/gtk/button.cpp index 73758e1288..a524f34495 100644 --- a/src/gtk/button.cpp +++ b/src/gtk/button.cpp @@ -273,9 +273,11 @@ void wxButton::DoApplyWidgetStyle(GtkRcStyle *style) if (GTK_IS_ALIGNMENT (child)) { GtkWidget *box = GTK_BIN(child)->child; if (GTK_IS_BOX (box)) { - GList *items = gtk_container_get_children(GTK_CONTAINER(box)); - for (GList *item = items; item; item = item->next) - gtk_widget_modify_style(GTK_WIDGET(item->data), style); + for (GList* item = GTK_BOX(box)->children; item; item = item->next) + { + GtkBoxChild* boxChild = wx_static_cast(GtkBoxChild*, item->data); + gtk_widget_modify_style(boxChild->widget, style); + } } } }