aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2018-02-22 11:14:33 -0500
committerMike Blumenkrantz <zmike@osg.samsung.com>2018-02-22 11:14:33 -0500
commit846c84639b7bfba45762997871b92ea2b4bdcfb5 (patch)
tree84d85bbe6418301be2c471c3febcb11b78a4e69e
parentdisable bounce for gadget bar scrollers (diff)
downloadenlightenment-846c84639b7bfba45762997871b92ea2b4bdcfb5.tar.gz
use per-instance event handler for batman powersave eventing
==19679== Invalid read of size 4 ==19679== at 0x5CC90EF: _ecore_event_message_handler_handler_del (ecore_event_message_handler.c:194) ==19679== by 0x5CCA332: ecore_event_message_handler_del (ecore_event_message_handler.eo.c:22) ==19679== by 0x5CBC7E3: ecore_event_handler_del (ecore_events.c:51) ==19679== by 0x2A23F4F1: _batman_removed_cb (batman.c:579) ==19679== by 0x6A9A33D: _eo_evas_smart_cb (evas_object_smart.c:78) ==19679== by 0xC166F4D: _event_callback_call (eo_base_class.c:1560) ==19679== by 0xC16728E: _efl_object_event_callback_legacy_call (eo_base_class.c:1633) ==19679== by 0xC167334: efl_event_callback_legacy_call (eo_base_class.c:1636) ==19679== by 0x6A889CA: _efl_canvas_object_efl_object_event_callback_legacy_call (evas_object_main.c:1157) ==19679== by 0xC167334: efl_event_callback_legacy_call (eo_base_class.c:1636) ==19679== by 0x6A9CBA7: evas_object_smart_callback_call (evas_object_smart.c:1037) ==19679== by 0x500B1D: _gadget_remove (e_gadget.c:426) ==19679== by 0x5037A9: _gadget_menu_remove (e_gadget.c:1263) ==19679== by 0x552600: _e_menu_active_call (e_menu.c:2066) ==19679== by 0x55445E: _e_menu_cb_mouse_up (e_menu.c:2809) ==19679== by 0x5CC9933: _ecore_event_message_handler_efl_loop_message_handler_message_call (ecore_event_message_handler.c:359) ==19679== by 0x5CD31D1: efl_loop_message_handler_message_call (efl_loop_message_handler.eo.c:14) ==19679== by 0x5CCDA73: _efl_loop_message_process (efl_loop.c:681) ==19679== by 0x5CCDC64: efl_loop_message_process (efl_loop.c:711) ==19679== by 0x5CC7453: _ecore_main_loop_iterate_internal (ecore_main.c:2444) ==19679== by 0x5CC457E: _ecore_main_loop_begin (ecore_main.c:1173) ==19679== by 0x5CCC0CD: _efl_loop_begin (efl_loop.c:97) ==19679== by 0x5CCED13: efl_loop_begin (efl_loop.eo.c:50) ==19679== by 0x5CC46F7: ecore_main_loop_begin (ecore_main.c:1246) ==19679== by 0x5476B6: main (e_main.c:1092) ==19679== Address 0x212af268 is 40 bytes inside a block of size 48 free'd ==19679== at 0x4C30D18: free (vg_replace_malloc.c:530) ==19679== by 0x5CC9BE6: _ecore_event_message_handler_efl_loop_message_handler_message_call (ecore_event_message_handler.c:389) ==19679== by 0x5CD31D1: efl_loop_message_handler_message_call (efl_loop_message_handler.eo.c:14) ==19679== by 0x5CCDA73: _efl_loop_message_process (efl_loop.c:681) ==19679== by 0x5CCDC64: efl_loop_message_process (efl_loop.c:711) ==19679== by 0x5CC7453: _ecore_main_loop_iterate_internal (ecore_main.c:2444) ==19679== by 0x5CC457E: _ecore_main_loop_begin (ecore_main.c:1173) ==19679== by 0x5CCC0CD: _efl_loop_begin (efl_loop.c:97) ==19679== by 0x5CCED13: efl_loop_begin (efl_loop.eo.c:50) ==19679== by 0x5CC46F7: ecore_main_loop_begin (ecore_main.c:1246) ==19679== by 0x5476B6: main (e_main.c:1092) ==19679== Block was alloc'd at ==19679== at 0x4C31A1E: calloc (vg_replace_malloc.c:711) ==19679== by 0x5CC8EE1: _ecore_event_message_handler_handler_add (ecore_event_message_handler.c:148) ==19679== by 0x5CCA0FB: ecore_event_message_handler_add (ecore_event_message_handler.eo.c:14) ==19679== by 0x5CBC790: ecore_event_handler_add (ecore_events.c:35) ==19679== by 0x2A23FB87: _batman_created_cb (batman.c:661) ==19679== by 0x6A9A33D: _eo_evas_smart_cb (evas_object_smart.c:78) ==19679== by 0xC166F4D: _event_callback_call (eo_base_class.c:1560) ==19679== by 0xC16728E: _efl_object_event_callback_legacy_call (eo_base_class.c:1633) ==19679== by 0xC167334: efl_event_callback_legacy_call (eo_base_class.c:1636) ==19679== by 0x6A889CA: _efl_canvas_object_efl_object_event_callback_legacy_call (evas_object_main.c:1157) ==19679== by 0xC167334: efl_event_callback_legacy_call (eo_base_class.c:1636) ==19679== by 0x6A9CBA7: evas_object_smart_callback_call (evas_object_smart.c:1037) ==19679== by 0x501172: _gadget_object_create (e_gadget.c:548) ==19679== by 0x506B90: e_gadget_type_add (e_gadget.c:2056) ==19679== by 0x2A23CA44: sysinfo_init (mod.c:161) ==19679== by 0x2A23CCF5: e_modapi_init (mod.c:203) ==19679== by 0x556814: e_module_enable (e_module.c:524) ==19679== by 0x555DF9: e_module_all_load (e_module.c:324) ==19679== by 0x554EFF: _module_done_cb (e_module.c:73) ==19679== by 0x73531C1: eio_async_end (eio_file.c:510) ==19679== by 0x5CF8D67: _ecore_thread_kill (ecore_thread.c:229) ==19679== by 0x5CF8E1C: _ecore_thread_handler (ecore_thread.c:256) ==19679== by 0x5CB97D0: _ecore_main_call_flush (ecore.c:1090) ==19679== by 0x5CB9858: _thread_callback (ecore.c:1101) ==19679== by 0x5CF51F3: _ecore_pipe_handler_call (ecore_pipe.c:602) ==19679== by 0x5CF5529: _ecore_pipe_read (ecore_pipe.c:725) ==19679== by 0x5CC3677: _ecore_call_fd_cb (ecore_private.h:476) ==19679== by 0x5CC6793: _ecore_main_fd_handlers_call (ecore_main.c:2051) ==19679== by 0x5CC7414: _ecore_main_loop_iterate_internal (ecore_main.c:2439) ==19679== by 0x5CC457E: _ecore_main_loop_begin (ecore_main.c:1173) ==19679== by 0x5CCC0CD: _efl_loop_begin (efl_loop.c:97) ==19679== by 0x5CCED13: efl_loop_begin (efl_loop.eo.c:50) ==19679== by 0x5CC46F7: ecore_main_loop_begin (ecore_main.c:1246) ==19679== by 0x5476B6: main (e_main.c:1092)
-rw-r--r--src/modules/sysinfo/batman/batman.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/src/modules/sysinfo/batman/batman.c b/src/modules/sysinfo/batman/batman.c
index cf9ddfab5..085ca31df 100644
--- a/src/modules/sysinfo/batman/batman.c
+++ b/src/modules/sysinfo/batman/batman.c
@@ -1,17 +1,15 @@
#include "batman.h"
-Eina_Bool upower;
-Eina_List *batman_device_batteries;
-Eina_List *batman_device_ac_adapters;
-double batman_init_time;
+EINTERN Eina_Bool upower;
+EINTERN Eina_List *batman_device_batteries;
+EINTERN Eina_List *batman_device_ac_adapters;
+EINTERN double batman_init_time;
static Eina_Bool _batman_cb_warning_popup_timeout(void *data);
static void _batman_cb_warning_popup_hide(void *data, Evas *e, Evas_Object *obj, void *event);
static void _batman_warning_popup_destroy(Instance *inst);
static void _batman_warning_popup(Instance *inst, int time, double percent);
-static Ecore_Event_Handler *_handler = NULL;
-
Eina_List *
_batman_battery_find(const char *udi)
{
@@ -575,8 +573,6 @@ _batman_removed_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_data)
Ecore_Event_Handler *handler;
if (inst->o_main != event_data) return;
- if (_handler)
- ecore_event_handler_del(_handler);
if (inst->cfg->batman.popup)
E_FREE_FUNC(inst->cfg->batman.popup, evas_object_del);
if (inst->cfg->batman.configure)
@@ -658,13 +654,13 @@ _batman_created_cb(void *data, Evas_Object *obj, void *event_data EINA_UNUSED)
EVAS_CALLBACK_MOUSE_DOWN,
_batman_mouse_down_cb, inst);
evas_object_event_callback_add(inst->cfg->batman.o_gadget, EVAS_CALLBACK_RESIZE, _batman_resize_cb, inst);
- _handler = ecore_event_handler_add(E_EVENT_POWERSAVE_CONFIG_UPDATE,
- _powersave_cb_config_update, inst);
evas_object_show(inst->cfg->batman.o_gadget);
evas_object_smart_callback_del_full(obj, "gadget_created", _batman_created_cb, data);
E_LIST_HANDLER_APPEND(inst->cfg->batman.handlers, E_EVENT_SCREENSAVER_ON, _screensaver_on, inst);
- E_LIST_HANDLER_APPEND(inst->cfg->batman.handlers, E_EVENT_SCREENSAVER_OFF, _screensaver_off, inst);
+ E_LIST_HANDLER_APPEND(inst->cfg->batman.handlers, E_EVENT_SCREENSAVER_ON, _screensaver_on, inst);
+ E_LIST_HANDLER_APPEND(inst->cfg->batman.handlers, E_EVENT_POWERSAVE_CONFIG_UPDATE,
+ _powersave_cb_config_update, inst);
_batman_config_updated(inst);
}
@@ -686,12 +682,12 @@ sysinfo_batman_create(Evas_Object *parent, Instance *inst)
EVAS_CALLBACK_MOUSE_DOWN,
_batman_mouse_down_cb, inst);
evas_object_event_callback_add(inst->cfg->batman.o_gadget, EVAS_CALLBACK_RESIZE, _batman_resize_cb, inst);
- _handler = ecore_event_handler_add(E_EVENT_POWERSAVE_CONFIG_UPDATE,
- _powersave_cb_config_update, inst);
evas_object_show(inst->cfg->batman.o_gadget);
E_LIST_HANDLER_APPEND(inst->cfg->batman.handlers, E_EVENT_SCREENSAVER_ON, _screensaver_on, inst);
E_LIST_HANDLER_APPEND(inst->cfg->batman.handlers, E_EVENT_SCREENSAVER_OFF, _screensaver_off, inst);
+ E_LIST_HANDLER_APPEND(inst->cfg->batman.handlers, E_EVENT_POWERSAVE_CONFIG_UPDATE,
+ _powersave_cb_config_update, inst);
_batman_config_updated(inst);
@@ -761,4 +757,3 @@ batman_create(Evas_Object *parent, int *id, E_Gadget_Site_Orient orient EINA_UNU
return inst->o_main;
}
-