summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Hirt <daniel.hirt@samsung.com>2015-08-20 14:49:09 +0300
committerDaniel Hirt <daniel.hirt@samsung.com>2015-08-20 14:49:09 +0300
commit513d988c7d3b611b2c77d167ac4d69039d023e4f (patch)
treef172af26b450c49b5ce73d3801c0b6ad09cd4d66
parent09738f6d89b0ba2060fdf4d54ebf05ee95868fd1 (diff)
Cleanup decorations on close
-rw-r--r--src/lib/eo_preload.c36
1 files changed, 29 insertions, 7 deletions
diff --git a/src/lib/eo_preload.c b/src/lib/eo_preload.c
index 8f4713d..9615c87 100644
--- a/src/lib/eo_preload.c
+++ b/src/lib/eo_preload.c
@@ -306,6 +306,7 @@ _textblock_populate_items(Evas_Object *tb, Debug_Decorate *dec)
306 EINA_INLIST_GET(dec->rects), 306 EINA_INLIST_GET(dec->rects),
307 EINA_INLIST_GET(r)); 307 EINA_INLIST_GET(r));
308 evas_object_show(r->obj); 308 evas_object_show(r->obj);
309 eina_rectangle_free(d->rect);
309 } 310 }
310} 311}
311 312
@@ -380,15 +381,19 @@ _textblock_rects_populate(Evas_Object *tb, Debug_Decorate *dec)
380} 381}
381 382
382 383
383/* Clears debug rectangles for given obj */ 384/* Clears debug rectangles for given obj
385 * @param rem whether to evas_object_del the obj or not */
384static void 386static void
385_clear_rects(Debug_Decorate *dec) 387_clear_rects(Debug_Decorate *dec, Eina_Bool rem)
386{ 388{
387 Debug_Rect *rect; 389 Debug_Rect *rect;
388 390
389 EINA_INLIST_FREE(EINA_INLIST_GET(dec->rects), rect) 391 EINA_INLIST_FREE(EINA_INLIST_GET(dec->rects), rect)
390 { 392 {
391 evas_object_del(rect->obj); 393 if (rem)
394 {
395 evas_object_del(rect->obj);
396 }
392 if (rect->src_data) 397 if (rect->src_data)
393 { 398 {
394 free(rect->src_data); 399 free(rect->src_data);
@@ -425,7 +430,7 @@ _decorate_update(Evas_Object *obj)
425 return NULL; 430 return NULL;
426 } 431 }
427 432
428 _clear_rects(dec); 433 _clear_rects(dec, EINA_TRUE);
429 return dec; 434 return dec;
430} 435}
431 436
@@ -437,7 +442,6 @@ _decorate_entry(Evas_Object *obj)
437 _textblock_rects_populate(tb, dec); 442 _textblock_rects_populate(tb, dec);
438} 443}
439 444
440
441static Eina_Bool 445static Eina_Bool
442_on_entry_changed(void *data, Eo *obj, const Eo_Event_Description *desc, void *event_info) 446_on_entry_changed(void *data, Eo *obj, const Eo_Event_Description *desc, void *event_info)
443{ 447{
@@ -446,6 +450,20 @@ _on_entry_changed(void *data, Eo *obj, const Eo_Event_Description *desc, void *e
446 return EINA_TRUE; 450 return EINA_TRUE;
447} 451}
448 452
453static void
454_decors_free(void)
455{
456 Debug_Decorate *dec;
457 EINA_INLIST_FREE(g_decor, dec)
458 {
459 _clear_rects(dec, EINA_FALSE);
460 g_decor = (Debug_Decorate *) eina_inlist_remove(
461 EINA_INLIST_GET(g_decor),
462 EINA_INLIST_GET(dec));
463 free(dec);
464 }
465}
466
449static Debug_Decorate * 467static Debug_Decorate *
450_decorate_create(Evas_Object *obj) 468_decorate_create(Evas_Object *obj)
451{ 469{
@@ -486,10 +504,10 @@ _eo_add_internal_start(const char *file, int line, const Eo_Class *klass_id, Eo
486 eo_do(ret, eo_event_callback_add(ELM_ENTRY_EVENT_CHANGED_USER, _on_entry_changed, dec)); 504 eo_do(ret, eo_event_callback_add(ELM_ENTRY_EVENT_CHANGED_USER, _on_entry_changed, dec));
487 eo_do(ret, eo_event_callback_add(EVAS_OBJECT_EVENT_RESIZE, _on_entry_changed, dec)); 505 eo_do(ret, eo_event_callback_add(EVAS_OBJECT_EVENT_RESIZE, _on_entry_changed, dec));
488 eo_do(ret, eo_event_callback_add(EVAS_OBJECT_EVENT_DEL, _on_obj_del, dec)); 506 eo_do(ret, eo_event_callback_add(EVAS_OBJECT_EVENT_DEL, _on_obj_del, dec));
489 507
490 elm_object_tooltip_content_cb_set(ret, _entry_tooltip_content_cb, NULL, _on_label_del); 508 elm_object_tooltip_content_cb_set(ret, _entry_tooltip_content_cb, NULL, _on_label_del);
491 509
492 elm_object_tooltip_show_delay_set(ret, 0.0); 510 // elm_object_tooltip_show_delay_set(ret, 0.0);
493 } 511 }
494 return ret; 512 return ret;
495} 513}
@@ -508,4 +526,8 @@ elm_run()
508{ 526{
509 void (*f)() = dlsym(RTLD_NEXT, __func__); 527 void (*f)() = dlsym(RTLD_NEXT, __func__);
510 f(); 528 f();
529
530 /* Cleanup */
531 _decors_free();
532
511} 533}