Enlightenment CVS committal

Author  : jethomas
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/src/bin


Modified Files:
        main.c 


Log Message:
Model and view need to be freed

===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/bin/main.c,v
retrieving revision 1.87
retrieving revision 1.88
diff -u -3 -r1.87 -r1.88
--- main.c      29 Nov 2007 03:50:42 -0000      1.87
+++ main.c      2 Dec 2007 19:06:11 -0000       1.88
@@ -78,6 +78,7 @@
 static int ewl_test_cb_unit_test_timer(void *data);
 static void ewl_test_cb_delete_window(Ewl_Widget *w, void *ev, void *data);
 static void ewl_test_cb_exit(Ewl_Widget *w, void *ev, void *data);
+static void ewl_cb_mvc_free(Ewl_Widget *w, void *ev, void *data);
 static void cb_run_unit_tests(Ewl_Widget *w, void *ev, void *data);
 
 static void ewl_test_cb_help(Ewl_Widget *w, void *ev, void *data);
@@ -610,6 +611,8 @@
        ewl_mvc_data_set(EWL_MVC(tree), categories);
        ewl_callback_append(tree, EWL_CALLBACK_VALUE_CHANGED,
                                ewl_test_cb_test_selected, NULL);
+       ewl_callback_append(tree, EWL_CALLBACK_DESTROY, ewl_cb_mvc_free,
+                                                       NULL);
        ewl_widget_show(tree);
 
 
@@ -656,7 +659,7 @@
        ewl_model_data_header_fetch_set(model, cb_unit_test_header_data_fetch);
        ewl_model_data_count_set(model, cb_unit_test_count);
 
-       view = ewl_view_clone(ewl_label_view_get());
+       view = ewl_label_view_get();
        ewl_view_header_fetch_set(view, cb_unit_test_header_fetch);
 
        o2 = ewl_tree2_new();
@@ -665,6 +668,8 @@
        ewl_mvc_model_set(EWL_MVC(o2), model);
        ewl_mvc_view_set(EWL_MVC(o2), view);
        ewl_widget_name_set(o2, "unit_test_tree");
+       ewl_callback_append(o2, EWL_CALLBACK_DESTROY, ewl_cb_mvc_free,
+                                                       NULL);
        ewl_widget_show(o2);
 
        o2 = ewl_hbox_new();
@@ -1338,4 +1343,16 @@
                ;
 
        return i;
+}
+
+static void
+ewl_cb_mvc_free(Ewl_Widget *w, void *ev, void *data)
+{
+       Ewl_Model *model;
+       Ewl_View *view;
+
+       model = ewl_mvc_model_get(EWL_MVC(w));
+       free(model);
+       view = ewl_mvc_view_get(EWL_MVC(w));
+       free(view);
 }



-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to