Re: Segfault on Gtk::ListStore::clear ()



I added some code to one of the example programs in gtkmm-tutorial,
https://gitlab.gnome.org/GNOME/gtkmm-documentation/-/tree/gtkmm-3-24/examples/book/combobox/complex

ExampleWindow::~ExampleWindow()
{
  Gtk::TreeIter iList = m_refTreeModel->get_iter("0");
  while (iList)
  {
    std::cout << (*iList)[m_Columns.m_col_name] << std::endl;
    ++iList;
  }
  m_refTreeModel->clear();
}

No segfault!

You should use a debugger, such as gdb, to find out where the segfault is generated.

/Kjell

On 2020-12-01 17:27, Phil Wolff via gtkmm-list wrote:
Consider this Gtk::ListStore (in a Gtk::ComboBox, if that matters):

            Gtk::TreeIter iList = m_refServModel->get_iter( "0" );
            while ( iList ) {
                std::cout << (*iList)[m_cServings.m_sStdServ] << std::endl;
                ++iList;
            }
            m_refServModel->clear ();

The while() loop correctly displays the several items in the list, but the clear() generates a segfault.

Any insight would be appreciated!



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]