summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYoungbok Shin <youngb.shin@samsung.com>2017-01-22 11:03:14 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2017-01-22 11:03:14 +0900
commitca075ce21f9c267aa7186b96a6e4dc51d36c1206 (patch)
tree755f602d0819764e95a288668b53004a8d8bbda9
parent6e8b62886447d23dcbbd271f4842b8bb153d3db0 (diff)
elementary conformant: clear internal pointer if holded object is deleted
Summary: Set sd->scroller as NULL when the scroller object is deleted. It prevents error logs when elm_conform tries to delete resize callback function from deleted object. @fix Test Plan: N/A Reviewers: raster, cedric, jpeg Differential Revision: https://phab.enlightenment.org/D4519
-rw-r--r--src/lib/elementary/elm_conform.c24
1 files changed, 20 insertions, 4 deletions
diff --git a/src/lib/elementary/elm_conform.c b/src/lib/elementary/elm_conform.c
index ac1e6f4a53..0ca7c86a01 100644
--- a/src/lib/elementary/elm_conform.c
+++ b/src/lib/elementary/elm_conform.c
@@ -693,6 +693,15 @@ _on_content_resize(void *data,
693 sd->show_region_job = ecore_job_add(_show_region_job, data); 693 sd->show_region_job = ecore_job_add(_show_region_job, data);
694} 694}
695 695
696static void
697_on_top_scroller_del(void *data, const Efl_Event *event)
698{
699 ELM_CONFORMANT_DATA_GET(data, sd);
700
701 if (event->object == sd->scroller)
702 sd->scroller = NULL;
703}
704
696#endif 705#endif
697 706
698#ifdef HAVE_ELEMENTARY_X 707#ifdef HAVE_ELEMENTARY_X
@@ -721,13 +730,20 @@ _autoscroll_objects_update(void *data)
721 if (top_scroller != sd->scroller) 730 if (top_scroller != sd->scroller)
722 { 731 {
723 if (sd->scroller) 732 if (sd->scroller)
724 evas_object_event_callback_del 733 {
725 (sd->scroller, EVAS_CALLBACK_RESIZE, _on_content_resize); 734 evas_object_event_callback_del_full
735 (sd->scroller, EVAS_CALLBACK_RESIZE, _on_content_resize, data);
736 efl_event_callback_del(sd->scroller, EFL_EVENT_DEL, _on_top_scroller_del, data);
737 }
738
726 sd->scroller = top_scroller; 739 sd->scroller = top_scroller;
727 740
728 if (sd->scroller) 741 if (sd->scroller)
729 evas_object_event_callback_add 742 {
730 (sd->scroller, EVAS_CALLBACK_RESIZE, _on_content_resize, data); 743 evas_object_event_callback_add
744 (sd->scroller, EVAS_CALLBACK_RESIZE, _on_content_resize, data);
745 efl_event_callback_add(sd->scroller, EFL_EVENT_DEL, _on_top_scroller_del, data);
746 }
731 } 747 }
732} 748}
733 749