WWW-www.enlightenment.org pushed a commit to branch master.

http://git.enlightenment.org/website/www-content.git/commit/?id=4db4870faf7b74eb25a83c5eadb3666a0dd70bd1

commit 4db4870faf7b74eb25a83c5eadb3666a0dd70bd1
Author: Xavi Artigas <[email protected]>
Date:   Fri Nov 17 04:27:23 2017 -0800

    Wiki page eo-classes.md changed with summary [added missing efl_unref()] by 
Xavi Artigas
---
 pages/develop/tutorial/c/eo-classes.md.txt | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/pages/develop/tutorial/c/eo-classes.md.txt 
b/pages/develop/tutorial/c/eo-classes.md.txt
index 1a5b041b..41aaedd7 100644
--- a/pages/develop/tutorial/c/eo-classes.md.txt
+++ b/pages/develop/tutorial/c/eo-classes.md.txt
@@ -262,8 +262,12 @@ And call it from ``efl_main()``, right before calling 
``efl_exit()``:
    Eo *rectangle;
 
    rectangle = _rect_create();
+   
+   efl_unref(rectangle);
 ```
 
+Notice how the object is disposed of using ``efl_unref()`` before quitting. It 
is a good idea to write the code to remove objects at the same time you write 
the code that creates them, so you don't forget. Later on you will be doing 
more things with this ``rectangle``.
+
 Finally, instantiate a new object of your shiny new class from within 
``_rect_create()``:
 
 ```c
@@ -326,6 +330,8 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev 
EINA_UNUSED)
           example_rectangle_width_get(rectangle),
           example_rectangle_height_get(rectangle),
           example_rectangle_area(rectangle));
+          
+   efl_unref(rectangle);
 
    efl_exit(0);
 }

-- 


Reply via email to