From: Mart Raudsepp Date: Tue, 7 Mar 2006 06:55:26 +0000 (+0000) Subject: Apply patch #1443819 from Paul Cornett - move the GtkTreeIter to the outer scope... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/2eb1512ac8fad26e08db70d7d4780346798507df Apply patch #1443819 from Paul Cornett - move the GtkTreeIter to the outer scope as to not assign the address of an auto variable to an outer scope variable (now both are in the outer (function) scope). git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37850 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/gtk/listbox.cpp b/src/gtk/listbox.cpp index b49029ab73..439946ad05 100644 --- a/src/gtk/listbox.cpp +++ b/src/gtk/listbox.cpp @@ -615,14 +615,10 @@ void wxListBox::GtkInsertItems(const wxArrayString& items, int nCurCount = wxListBox::GetCount(); wxASSERT_MSG(pos <= nCurCount, wxT("Invalid index passed to wxListBox")); - GtkTreeIter* pIter; - if (pos == nCurCount) - { - pIter = NULL; // append - } - else + GtkTreeIter* pIter = NULL; // append by default + GtkTreeIter iter; + if (pos != nCurCount) { - GtkTreeIter iter; gboolean res = gtk_tree_model_iter_nth_child( GTK_TREE_MODEL(m_liststore), &iter, NULL, //NULL = parent = get first