diff --git a/src/gtk/dataview.cpp b/src/gtk/dataview.cpp index 71bc42f004..97476600e1 100644 --- a/src/gtk/dataview.cpp +++ b/src/gtk/dataview.cpp @@ -74,7 +74,8 @@ public: ~wxGtkTreePathList() { // Delete the list contents, wxGtkList will delete the list itself. - g_list_foreach(m_list, (GFunc)gtk_tree_path_free, NULL); + for (GList* p = m_list; p; p = p->next) + gtk_tree_path_free(static_cast(p->data)); } };