Index: gail/gailtreeview.c
===================================================================
RCS file: /cvs/gnome/gail/gail/gailtreeview.c,v
retrieving revision 1.181
diff -u -r1.181 gailtreeview.c
--- gail/gailtreeview.c	1 Nov 2005 17:02:17 -0000	1.181
+++ gail/gailtreeview.c	22 Nov 2005 18:23:25 -0000
@@ -2226,8 +2226,17 @@
                                GtkTreeIter        *iter,
                                GtkTreePath        *path)
 {
-  AtkObject *atk_obj = gtk_widget_get_accessible (GTK_WIDGET (tree_view));
-  GailTreeView *gailview = GAIL_TREE_VIEW (atk_obj);
+  AtkObject *atk_obj;
+  GailTreeView *gailview;
+
+  g_assert (GTK_IS_TREE_VIEW (tree_view));
+
+  atk_obj = gtk_widget_get_accessible (GTK_WIDGET (tree_view));
+
+  g_assert (GAIL_IS_TREE_VIEW (atk_obj));
+
+  gailview = GAIL_TREE_VIEW (atk_obj);
+
   /*
    * The visible rectangle has not been updated when this signal is emitted
    * so we process the signal when the GTK processing is completed
@@ -2248,8 +2257,13 @@
   GtkTreeModel *tree_model;
   gint n_inserted, row;
 
+  g_assert (GTK_IS_TREE_VIEW (tree_view));
+
   tree_model = gtk_tree_view_get_model(tree_view);
-  if (!gtk_tree_model_get_iter (tree_model, &iter, path))
+
+  g_assert (GTK_IS_TREE_MODEL (tree_model));
+
+  if (!path || !gtk_tree_model_get_iter (tree_model, &iter, path))
       return FALSE;
 
   /*
@@ -2294,8 +2308,9 @@
   
   g_signal_emit_by_name (gailview, "row_inserted", row, n_inserted);
 
+  gailview->idle_expand_path = NULL;
+
   gtk_tree_path_free (path);
-  g_free (data);
   return FALSE;
 }
 
@@ -3607,6 +3622,8 @@
       GtkTreeView *gtk_tree_view;
       GList *temp_list;
       GtkWidget *widget;
+
+      g_assert (GTK_IS_ACCESSIBLE (tree_view));
 
       widget = GTK_ACCESSIBLE (tree_view)->widget;
       if (!widget)
