From e21074e0b1acb579094259f66aa3dd0f7a5c4499 Mon Sep 17 00:00:00 2001 From: John Darrington Date: Wed, 10 Aug 2016 01:21:57 +0200 Subject: [PATCH] Initialise iter stamp and fix compiler warning --- src/ui/gui/psppire-data-store.c | 7 ++++++- src/ui/gui/psppire-data-store.h | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/ui/gui/psppire-data-store.c b/src/ui/gui/psppire-data-store.c index 27f5502d3b..40f033c392 100644 --- a/src/ui/gui/psppire-data-store.c +++ b/src/ui/gui/psppire-data-store.c @@ -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 (); } /* diff --git a/src/ui/gui/psppire-data-store.h b/src/ui/gui/psppire-data-store.h index 47ce5e5e72..6b6d755e6e 100644 --- a/src/ui/gui/psppire-data-store.h +++ b/src/ui/gui/psppire-data-store.h @@ -72,6 +72,7 @@ struct _PsppireDataStore gboolean dispose_has_run ; PsppireDict *dict; struct datasheet *datasheet; + gint stamp; gint dict_handler_id [n_dict_signals]; }; -- 2.30.2