summaryrefslogtreecommitdiff
path: root/src/lib/ecore/efl_io_buffered_stream.c
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2018-05-01 13:30:44 -0700
committerCedric BAIL <cedric@osg.samsung.com>2018-05-24 16:02:18 -0700
commit266dabc0965c3920bf6681205c776e5ade0a9704 (patch)
tree571a602c71e03b8303fbe60ba3ac27d19c976bd6 /src/lib/ecore/efl_io_buffered_stream.c
parent0ac6e47697f3c1988fb8f8230e5998e0bf2fa142 (diff)
ecore: force close during invalidate of Efl.Io.Buffered_Stream.
Differential Revision: https://phab.enlightenment.org/D6074
Diffstat (limited to 'src/lib/ecore/efl_io_buffered_stream.c')
-rw-r--r--src/lib/ecore/efl_io_buffered_stream.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/lib/ecore/efl_io_buffered_stream.c b/src/lib/ecore/efl_io_buffered_stream.c
index 3a0921f959..a02b6bbb3e 100644
--- a/src/lib/ecore/efl_io_buffered_stream.c
+++ b/src/lib/ecore/efl_io_buffered_stream.c
@@ -16,6 +16,7 @@ typedef struct
16 Eo *outgoing; 16 Eo *outgoing;
17 Eo *sender; 17 Eo *sender;
18 Eo *receiver; 18 Eo *receiver;
19 Eina_Bool is_closing;
19 Eina_Bool closed; 20 Eina_Bool closed;
20 Eina_Bool eos; 21 Eina_Bool eos;
21 Eina_Bool can_read; 22 Eina_Bool can_read;
@@ -151,6 +152,9 @@ _efl_io_buffered_stream_efl_object_finalize(Eo *o, Efl_Io_Buffered_Stream_Data *
151EOLIAN static void 152EOLIAN static void
152_efl_io_buffered_stream_efl_object_invalidate(Eo *o, Efl_Io_Buffered_Stream_Data *pd) 153_efl_io_buffered_stream_efl_object_invalidate(Eo *o, Efl_Io_Buffered_Stream_Data *pd)
153{ 154{
155 if (!efl_io_closer_closed_get(o))
156 efl_io_closer_close(o);
157
154 if (pd->inner_io) 158 if (pd->inner_io)
155 { 159 {
156 efl_event_callback_array_del(pd->inner_io, _efl_io_buffered_stream_inner_io_cbs(), o); 160 efl_event_callback_array_del(pd->inner_io, _efl_io_buffered_stream_inner_io_cbs(), o);
@@ -168,7 +172,6 @@ _efl_io_buffered_stream_efl_object_invalidate(Eo *o, Efl_Io_Buffered_Stream_Data
168 172
169 if (!pd->is_finished) 173 if (!pd->is_finished)
170 { 174 {
171 fprintf(stderr, "forced finish\n");
172 pd->is_finished = EINA_TRUE; 175 pd->is_finished = EINA_TRUE;
173 efl_event_callback_call(o, EFL_IO_BUFFERED_STREAM_EVENT_FINISHED, NULL); 176 efl_event_callback_call(o, EFL_IO_BUFFERED_STREAM_EVENT_FINISHED, NULL);
174 } 177 }
@@ -182,6 +185,8 @@ _efl_io_buffered_stream_efl_io_closer_close(Eo *o, Efl_Io_Buffered_Stream_Data *
182 Eina_Error err = 0; 185 Eina_Error err = 0;
183 186
184 EINA_SAFETY_ON_TRUE_RETURN_VAL(pd->closed, EINVAL); 187 EINA_SAFETY_ON_TRUE_RETURN_VAL(pd->closed, EINVAL);
188 if (pd->is_closing) return 0;
189 pd->is_closing = EINA_TRUE;
185 190
186 if (pd->outgoing) 191 if (pd->outgoing)
187 { 192 {