evas: move clearing cows to right place.
Summary:
Evas is child of main loop now, so evas is deleted when main loop is quitted.
In case of not calling evas_free() explicitly by app side, a crash occurs.
So move clearing cows to below ecore_shutdown().
Test Plan:
//Compile with:
//gcc evas_test.c -o evas_test `pkg-config --cflags --libs ecore evas`
#include <Evas.h>
#include <Ecore.h>
Eina_Bool
_timer_cb (void *data)
{
ecore_main_loop_quit();
return 0;
}
int
main(int argc, char *argv[])
{
evas_init();
Evas *evas = evas_new();
Evas_Object *obj = evas_object_box_add(evas);
Evas_Object *rect = evas_object_rectangle_add(evas);
evas_object_color_set(rect, 255, 255, 255, 255);
evas_object_resize(rect, 300, 400);
evas_object_show(rect);
evas_object_box_append(obj, rect);
evas_object_show(obj);
ecore_timer_add(2.0, _timer_cb, NULL);
ecore_main_loop_begin();
evas_shutdown();
return 0;
}
Reviewers: devilhorns, cedric, jpeg, id213sin, woohyun, zmike
Reviewed By: zmike
Subscribers: cedric, #committers, zmike
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D6346
2018-06-27 04:50:30 -07:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "config.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
#include <Evas.h>
|
|
|
|
|
|
|
|
#include "evas_suite.h"
|
|
|
|
|
|
|
|
EFL_START_TEST(evas_free_none)
|
|
|
|
{
|
|
|
|
Evas *evas = evas_new();
|
|
|
|
Evas_Object *obj = evas_object_rectangle_add(evas);
|
2018-11-07 10:07:09 -08:00
|
|
|
ck_assert(obj != NULL);
|
evas: move clearing cows to right place.
Summary:
Evas is child of main loop now, so evas is deleted when main loop is quitted.
In case of not calling evas_free() explicitly by app side, a crash occurs.
So move clearing cows to below ecore_shutdown().
Test Plan:
//Compile with:
//gcc evas_test.c -o evas_test `pkg-config --cflags --libs ecore evas`
#include <Evas.h>
#include <Ecore.h>
Eina_Bool
_timer_cb (void *data)
{
ecore_main_loop_quit();
return 0;
}
int
main(int argc, char *argv[])
{
evas_init();
Evas *evas = evas_new();
Evas_Object *obj = evas_object_box_add(evas);
Evas_Object *rect = evas_object_rectangle_add(evas);
evas_object_color_set(rect, 255, 255, 255, 255);
evas_object_resize(rect, 300, 400);
evas_object_show(rect);
evas_object_box_append(obj, rect);
evas_object_show(obj);
ecore_timer_add(2.0, _timer_cb, NULL);
ecore_main_loop_begin();
evas_shutdown();
return 0;
}
Reviewers: devilhorns, cedric, jpeg, id213sin, woohyun, zmike
Reviewed By: zmike
Subscribers: cedric, #committers, zmike
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D6346
2018-06-27 04:50:30 -07:00
|
|
|
}
|
|
|
|
EFL_END_TEST
|
|
|
|
|
|
|
|
void evas_test_new(TCase *tc)
|
|
|
|
{
|
|
|
|
tcase_add_test(tc, evas_free_none);
|
|
|
|
}
|