[glib-controller] example: Set the array in MySimpleModel.clear



commit 632cb927ac54ba9ac6677c45dfc26c66fb110d84
Author: Emmanuele Bassi <ebassi linux intel com>
Date:   Wed May 5 15:25:45 2010 +0100

    example: Set the array in MySimpleModel.clear
    
    We replace the array with a new one, but we must also assign the new
    array to the model->array member.

 examples/simple-model.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
---
diff --git a/examples/simple-model.c b/examples/simple-model.c
index 311e082..b99d95d 100644
--- a/examples/simple-model.c
+++ b/examples/simple-model.c
@@ -174,6 +174,7 @@ my_simple_model_clear (MySimpleModel *model)
 
   array = g_ptr_array_new ();
   g_ptr_array_controller_set_array (G_PTR_ARRAY_CONTROLLER (model->controller), array);
+  model->array = array;
 
   ref = g_controller_create_reference (model->controller, G_CONTROLLER_CLEAR,
                                        G_TYPE_UINT, 0);



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