Initialise iter stamp and fix compiler warning
authorJohn Darrington <john@darrington.wattle.id.au>
Tue, 9 Aug 2016 23:21:57 +0000 (01:21 +0200)
committerJohn Darrington <john@darrington.wattle.id.au>
Tue, 9 Aug 2016 23:21:57 +0000 (01:21 +0200)
src/ui/gui/psppire-data-store.c
src/ui/gui/psppire-data-store.h

index 27f5502d3be6ad71e94d109e6b6da40b48bc07a1..40f033c392f443cd733cc51967fafc7e888413d7 100644 (file)
@@ -124,7 +124,9 @@ __iter_nth_child (GtkTreeModel *tree_model,
       return FALSE;
     }
   
-  iter->user_data = n;
+  iter->user_data = GINT_TO_POINTER (n);
+  iter->stamp = store->stamp;
+  
   return TRUE;
 }
 
@@ -138,6 +140,8 @@ __get_value (GtkTreeModel *tree_model,
 {
   PsppireDataStore *store  = PSPPIRE_DATA_STORE (tree_model);
 
+  g_return_if_fail (iter->stamp == store->stamp);
+  
   const struct variable *variable = psppire_dict_get_variable (store->dict, column);
   if (NULL == variable)
     return;
@@ -326,6 +330,7 @@ psppire_data_store_init (PsppireDataStore *data_store)
   data_store->dict = NULL;
   data_store->datasheet = NULL;
   data_store->dispose_has_run = FALSE;
+  data_store->stamp = g_random_int ();
 }
 
 /*
index 47ce5e5e729d22dc5f99325b30ceeb9d9c8dd6d5..6b6d755e6eb5ca90cb00ecba4d91e98238031288 100644 (file)
@@ -72,6 +72,7 @@ struct _PsppireDataStore
   gboolean dispose_has_run ;
   PsppireDict *dict;
   struct datasheet *datasheet;
+  gint stamp;
 
   gint dict_handler_id [n_dict_signals];
 };