summaryrefslogtreecommitdiff
path: root/src/bindings
diff options
context:
space:
mode:
authorVitor Sousa <vitorsousasilva@gmail.com>2015-01-26 15:49:16 -0200
committerFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2015-04-14 01:06:57 -0300
commit5043dcb830e96aa11b04e3bebc935c1c4cc606f2 (patch)
tree169b8e4dbf17c1d249d50bdbf222cd322fe2c7a9 /src/bindings
parent3b441cdf4a83383f4cd55ca8569e8eb98d45868e (diff)
eo_cxx: Fix signal_connection disconnect crash
Fixed crash when disconnecting event inside of its own event callback. Instead of deleting the callback object immediately during disconnection (which causes the callback to be freed), the deletion is now scheduled for later (using ecore_main_loop_thread_safe_call_async). Updated some Makefiles to proper include ecore now that it is used in all event wrappers. Added a unit test to verify crashes under these circumstances.
Diffstat (limited to 'src/bindings')
-rw-r--r--src/bindings/eo_cxx/eo_event.hh9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/bindings/eo_cxx/eo_event.hh b/src/bindings/eo_cxx/eo_event.hh
index f3d2e516d7..44c66afcb6 100644
--- a/src/bindings/eo_cxx/eo_event.hh
+++ b/src/bindings/eo_cxx/eo_event.hh
@@ -7,6 +7,7 @@
7#define EFL_CXX_EO_EVENT_HH 7#define EFL_CXX_EO_EVENT_HH
8 8
9#include <Eo.h> 9#include <Eo.h>
10#include <Ecore.h>
10 11
11#include <functional> 12#include <functional>
12#include <memory> 13#include <memory>
@@ -95,7 +96,13 @@ struct _event_deleter
95 void operator()() const 96 void operator()() const
96 { 97 {
97 eo_do(_eo, ::eo_event_callback_del(_description, _cb, _data)); 98 eo_do(_eo, ::eo_event_callback_del(_description, _cb, _data));
98 delete _data; 99 ::ecore_main_loop_thread_safe_call_async(&_deleter_call, _data);
100 }
101
102private:
103 static void _deleter_call(void* data)
104 {
105 delete static_cast<F*>(data);
99 } 106 }
100 107
101 F* _data; 108 F* _data;