summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2018-04-09 16:56:36 -0700
committerCedric BAIL <cedric@osg.samsung.com>2018-05-01 10:39:01 -0700
commit3e648c475f8ccaa09f08e656efb1b6860a477a1b (patch)
tree5bdb49ae8568ae0f803453a34742eb9be88b31db /src/lib
parent2306a3b0907e71e893db2f8a5a23732d77239f12 (diff)
ecore: when relying on parent relationship for lifecycle, we should not use efl_del in the destructor.
Diffstat (limited to '')
-rw-r--r--src/lib/ecore/efl_io_buffered_stream.c37
-rw-r--r--src/lib/ecore/efl_io_buffered_stream.eo2
2 files changed, 15 insertions, 24 deletions
diff --git a/src/lib/ecore/efl_io_buffered_stream.c b/src/lib/ecore/efl_io_buffered_stream.c
index a787283002..75af9e42b0 100644
--- a/src/lib/ecore/efl_io_buffered_stream.c
+++ b/src/lib/ecore/efl_io_buffered_stream.c
@@ -149,29 +149,8 @@ _efl_io_buffered_stream_efl_object_finalize(Eo *o, Efl_Io_Buffered_Stream_Data *
149} 149}
150 150
151EOLIAN static void 151EOLIAN static void
152_efl_io_buffered_stream_efl_object_destructor(Eo *o, Efl_Io_Buffered_Stream_Data *pd) 152_efl_io_buffered_stream_efl_object_invalidate(Eo *o, Efl_Io_Buffered_Stream_Data *pd)
153{ 153{
154 if (pd->incoming)
155 {
156 efl_del(pd->incoming);
157 pd->incoming = NULL;
158 }
159 if (pd->outgoing)
160 {
161 efl_del(pd->outgoing);
162 pd->outgoing = NULL;
163 }
164 if (pd->sender)
165 {
166 efl_del(pd->sender);
167 pd->sender = NULL;
168 }
169 if (pd->receiver)
170 {
171 efl_del(pd->receiver);
172 pd->receiver = NULL;
173 }
174
175 if (pd->inner_io) 154 if (pd->inner_io)
176 { 155 {
177 efl_event_callback_array_del(pd->inner_io, _efl_io_buffered_stream_inner_io_cbs(), o); 156 efl_event_callback_array_del(pd->inner_io, _efl_io_buffered_stream_inner_io_cbs(), o);
@@ -182,7 +161,19 @@ _efl_io_buffered_stream_efl_object_destructor(Eo *o, Efl_Io_Buffered_Stream_Data
182 pd->inner_io = NULL; 161 pd->inner_io = NULL;
183 } 162 }
184 163
185 efl_destructor(efl_super(o, MY_CLASS)); 164 pd->incoming = NULL;
165 pd->outgoing = NULL;
166 pd->sender = NULL;
167 pd->receiver = NULL;
168
169 if (!pd->is_finished)
170 {
171 fprintf(stderr, "forced finish\n");
172 pd->is_finished = EINA_TRUE;
173 efl_event_callback_call(o, EFL_IO_BUFFERED_STREAM_EVENT_FINISHED, NULL);
174 }
175
176 efl_invalidate(efl_super(o, MY_CLASS));
186} 177}
187 178
188EOLIAN static Eina_Error 179EOLIAN static Eina_Error
diff --git a/src/lib/ecore/efl_io_buffered_stream.eo b/src/lib/ecore/efl_io_buffered_stream.eo
index 36d426306c..5c413aea91 100644
--- a/src/lib/ecore/efl_io_buffered_stream.eo
+++ b/src/lib/ecore/efl_io_buffered_stream.eo
@@ -247,7 +247,7 @@ class Efl.Io.Buffered_Stream (Efl.Loop_Consumer, Efl.Io.Reader, Efl.Io.Writer, E
247 247
248 implements { 248 implements {
249 Efl.Object.finalize; 249 Efl.Object.finalize;
250 Efl.Object.destructor; 250 Efl.Object.invalidate;
251 Efl.Io.Closer.close; 251 Efl.Io.Closer.close;
252 Efl.Io.Closer.closed { get; } 252 Efl.Io.Closer.closed { get; }
253 Efl.Io.Closer.close_on_exec { get; set; } 253 Efl.Io.Closer.close_on_exec { get; set; }