gtk_tree_store_remove crashes when I try to use it



Hi,

I've got an application which has a GtkTreeStore within it, it displays
a list of items, some parents for others.

I try to remove a row from this treestore in the following manner

void Queue_View::RemoveQueue(std::string name)
{
  GtkTreeIter iter;
		
  if(gtk_tree_model_get_iter_first(m_model,&iter) == true){

    while(true){
      char *str = NULL;
			
      gtk_tree_model_get(m_model,&iter,0,&str,-1);
			
      if(name == str){
        gtk_tree_store_remove(m_store,&iter);
        return;
      }else{
        if(gtk_tree_model_iter_next(m_model,&iter) == false) break;
      }
    }
  }
}

std::string name is the name of the row I want to remove

now, when I actually get to the gtk_tree_store_remove line of code, I
get this output to the console

urlgrabber:11533): Gtk-CRITICAL **: file gtktreestore.c: line 772
(gtk_tree_store_iter_parent): assertion `child->stamp == GTK_TREE_STORE
(tree_model)->stamp' failed

(urlgrabber:11533): Gtk-CRITICAL **: file gtktreestore.c: line 635
(gtk_tree_store_get_value): assertion `iter->stamp == GTK_TREE_STORE
(tree_model)->stamp' failed

(urlgrabber:11533): GLib-GObject-WARNING **: gtype.c:2967: type id `0'
is invalid

(urlgrabber:11533): GLib-GObject-WARNING **: can't peek value table for
type `<invalid>' which is not currently referenced
Press Enter to continue!

which is kinda weird, cause the iterator worked in retriving the string
containing the name of the row, therefore allowing me the compare
against a search name, so the iterator must be ok.

I thought about the m_store being buggered up somehow, but I add a new
queue immediately before trying to remove another, just so I can see if
it crashes out, it doesnt, so I guess that means the GtkTreeStore should
be ok.....

but it still doesnt work, so anyone out there know why this situation
would occur? or even some more information on those cryptic output
messages would be good.

thanks
-- 
kosh <evil_kosh_uk yahoo co uk>




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