evas/evas3d: call eo_unref() after eo_add().
authorChunEon Park <hermet@hermet.pe.kr>
Wed, 7 May 2014 10:36:45 +0000 (19:36 +0900)
committerChunEon Park <hermet@hermet.pe.kr>
Wed, 7 May 2014 10:36:45 +0000 (19:36 +0900)
since eo default ref count is 1 and increased by canvas parent again,
they should be unref() called if they wanna deleted automatically.

I wonder if evas unref the objects while it removes the objects from it's list,
then user don't need to call eo_unref() manually which may cause a mistake in usage.

src/examples/evas/evas-3d-cube.c
src/examples/evas/evas-3d-cube2.c
src/examples/evas/evas-3d-md2.c

index edcc5c5..7a5615f 100644 (file)
@@ -247,6 +247,7 @@ main(void)
 
    /* Add a background rectangle objects. */
    background = eo_add(EVAS_OBJ_RECTANGLE_CLASS, evas);
+   eo_unref(background);
    eo_do(background,
          evas_obj_color_set(0, 0, 0, 255),
          evas_obj_size_set(WIDTH, HEIGHT),
index cdf01c9..65672ab 100644 (file)
@@ -313,6 +313,7 @@ main(void)
 
    /* Add a background rectangle objects. */
    background = eo_add(EVAS_OBJ_RECTANGLE_CLASS, evas);
+   eo_unref(background);
    eo_do(background,
          evas_obj_color_set(0, 0, 0, 255),
          evas_obj_size_set(WIDTH, HEIGHT),
index 453ae63..fb0e736 100644 (file)
@@ -160,6 +160,7 @@ main(void)
 
    /* Add a background rectangle objects. */
    background = eo_add(EVAS_OBJ_RECTANGLE_CLASS, evas);
+   eo_unref(background);
    eo_do(background,
          evas_obj_color_set(0, 0, 0, 255),
          evas_obj_size_set(WIDTH, HEIGHT),