summaryrefslogtreecommitdiff
path: root/src/lib/ecore_con
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2018-04-17 16:17:29 -0700
committerCedric BAIL <cedric@osg.samsung.com>2018-05-01 10:39:01 -0700
commit33fd77e9e43b0fa29cb484b72d910bdf0ecccbc8 (patch)
tree0ebd1c0615445af5e1321a85b6878087b4cb54a8 /src/lib/ecore_con
parent193149deb85004aeda452dd4d729f995f4f313f9 (diff)
ecore: move close_on_destructor to close_on_invalidate as that describe the behavior best.
Fix all use to correctly behave on invalidate.
Diffstat (limited to 'src/lib/ecore_con')
-rw-r--r--src/lib/ecore_con/ecore_con_eet.c6
-rw-r--r--src/lib/ecore_con/ecore_con_legacy.c19
-rw-r--r--src/lib/ecore_con/ecore_con_url.c8
-rw-r--r--src/lib/ecore_con/efl_net_dialer_http.c20
-rw-r--r--src/lib/ecore_con/efl_net_dialer_http.eo3
-rw-r--r--src/lib/ecore_con/efl_net_dialer_simple.c25
-rw-r--r--src/lib/ecore_con/efl_net_dialer_simple.eo1
-rw-r--r--src/lib/ecore_con/efl_net_dialer_ssl.c10
-rw-r--r--src/lib/ecore_con/efl_net_dialer_ssl.eo1
-rw-r--r--src/lib/ecore_con/efl_net_dialer_tcp.c10
-rw-r--r--src/lib/ecore_con/efl_net_dialer_tcp.eo1
-rw-r--r--src/lib/ecore_con/efl_net_dialer_udp.c10
-rw-r--r--src/lib/ecore_con/efl_net_dialer_udp.eo1
-rw-r--r--src/lib/ecore_con/efl_net_dialer_unix.c10
-rw-r--r--src/lib/ecore_con/efl_net_dialer_unix.eo1
-rw-r--r--src/lib/ecore_con/efl_net_dialer_websocket.c8
-rw-r--r--src/lib/ecore_con/efl_net_dialer_websocket.eo2
-rw-r--r--src/lib/ecore_con/efl_net_server_simple.c6
-rw-r--r--src/lib/ecore_con/efl_net_server_ssl.c2
-rw-r--r--src/lib/ecore_con/efl_net_server_tcp.c2
-rw-r--r--src/lib/ecore_con/efl_net_server_udp.c2
-rw-r--r--src/lib/ecore_con/efl_net_server_udp_client.c20
-rw-r--r--src/lib/ecore_con/efl_net_server_udp_client.eo3
-rw-r--r--src/lib/ecore_con/efl_net_server_unix.c2
-rw-r--r--src/lib/ecore_con/efl_net_server_windows.c2
-rw-r--r--src/lib/ecore_con/efl_net_socket_fd.c12
-rw-r--r--src/lib/ecore_con/efl_net_socket_fd.eo3
-rw-r--r--src/lib/ecore_con/efl_net_socket_ssl.c18
-rw-r--r--src/lib/ecore_con/efl_net_socket_ssl.eo5
-rw-r--r--src/lib/ecore_con/efl_net_socket_windows.c20
-rw-r--r--src/lib/ecore_con/efl_net_socket_windows.eo2
31 files changed, 142 insertions, 93 deletions
diff --git a/src/lib/ecore_con/ecore_con_eet.c b/src/lib/ecore_con/ecore_con_eet.c
index 2b3a48b5cf..e5d07d5d9d 100644
--- a/src/lib/ecore_con/ecore_con_eet.c
+++ b/src/lib/ecore_con/ecore_con_eet.c
@@ -686,18 +686,18 @@ _ecore_con_eet_base_efl_object_constructor(Eo *obj, Ecore_Con_Eet_Base_Data *pd)
686EOLIAN static void 686EOLIAN static void
687_ecore_con_eet_base_efl_object_destructor(Eo *obj, Ecore_Con_Eet_Base_Data *pd) 687_ecore_con_eet_base_efl_object_destructor(Eo *obj, Ecore_Con_Eet_Base_Data *pd)
688{ 688{
689 efl_destructor(efl_super(obj, ECORE_CON_EET_BASE_CLASS));
690
691 eet_data_descriptor_free(pd->edd); 689 eet_data_descriptor_free(pd->edd);
692 eet_data_descriptor_free(pd->matching); 690 eet_data_descriptor_free(pd->matching);
693 eina_hash_free(pd->data_callbacks); 691 eina_hash_free(pd->data_callbacks);
694 eina_hash_free(pd->raw_data_callbacks); 692 eina_hash_free(pd->raw_data_callbacks);
693
694 efl_destructor(efl_super(obj, ECORE_CON_EET_BASE_CLASS));
695} 695}
696 696
697EOLIAN static Efl_Object * 697EOLIAN static Efl_Object *
698_ecore_con_eet_base_efl_object_finalize(Eo *obj, Ecore_Con_Eet_Base_Data *pd) 698_ecore_con_eet_base_efl_object_finalize(Eo *obj, Ecore_Con_Eet_Base_Data *pd)
699{ 699{
700 if (pd->server) return obj; 700 if (pd->server) return efl_finalize(efl_super(obj, ECORE_CON_EET_BASE_CLASS));
701 701
702 eet_data_descriptor_free(pd->edd); 702 eet_data_descriptor_free(pd->edd);
703 eet_data_descriptor_free(pd->matching); 703 eet_data_descriptor_free(pd->matching);
diff --git a/src/lib/ecore_con/ecore_con_legacy.c b/src/lib/ecore_con/ecore_con_legacy.c
index 356b25422a..a6246dba46 100644
--- a/src/lib/ecore_con/ecore_con_legacy.c
+++ b/src/lib/ecore_con/ecore_con_legacy.c
@@ -258,11 +258,11 @@ _ecore_con_client_socket_close(Ecore_Con_Client *cl)
258{ 258{
259 if (!cl->socket) return; 259 if (!cl->socket) return;
260 260
261 /* socket may remain alive due other references, we don't own it */
262 efl_event_callback_array_del(cl->socket, _ecore_con_client_socket_cbs(), cl);
263
264 if (!efl_io_closer_closed_get(cl->socket)) 261 if (!efl_io_closer_closed_get(cl->socket))
265 efl_io_closer_close(cl->socket); 262 efl_io_closer_close(cl->socket);
263
264 /* socket may remain alive due other references, we don't own it */
265 efl_event_callback_array_del(cl->socket, _ecore_con_client_socket_cbs(), cl);
266} 266}
267 267
268static void 268static void
@@ -278,7 +278,7 @@ _ecore_con_client_free(Ecore_Con_Client *cl)
278 if (cl->socket) 278 if (cl->socket)
279 { 279 {
280 Eo *parent, *inner_socket = efl_io_buffered_stream_inner_io_get(cl->socket); 280 Eo *parent, *inner_socket = efl_io_buffered_stream_inner_io_get(cl->socket);
281 efl_event_callback_array_del(cl->socket, _ecore_con_client_socket_cbs(), cl); 281
282 if (efl_isa(inner_socket, EFL_NET_SOCKET_SSL_CLASS)) 282 if (efl_isa(inner_socket, EFL_NET_SOCKET_SSL_CLASS))
283 efl_event_callback_array_del(inner_socket, _ecore_con_client_socket_ssl_cbs(), cl); 283 efl_event_callback_array_del(inner_socket, _ecore_con_client_socket_ssl_cbs(), cl);
284 284
@@ -843,11 +843,9 @@ _ecore_con_client_ssl_upgrade_job(void *data, const Eina_Value v,
843 843
844 efl_parent_set(inner_socket, socket); 844 efl_parent_set(inner_socket, socket);
845 845
846 efl_unref(inner_socket); /* socket keeps it */
847
848 cl->socket = socket; 846 cl->socket = socket;
849 efl_io_closer_close_on_exec_set(socket, EINA_TRUE); 847 efl_io_closer_close_on_exec_set(socket, EINA_TRUE);
850 efl_io_closer_close_on_destructor_set(socket, EINA_TRUE); 848 efl_io_closer_close_on_invalidate_set(socket, EINA_TRUE);
851 efl_event_callback_array_del(tcp_socket, _ecore_con_client_socket_cbs(), cl); 849 efl_event_callback_array_del(tcp_socket, _ecore_con_client_socket_cbs(), cl);
852 efl_event_callback_array_add(socket, _ecore_con_client_socket_cbs(), cl); 850 efl_event_callback_array_add(socket, _ecore_con_client_socket_cbs(), cl);
853 efl_event_callback_array_add(inner_socket, _ecore_con_client_socket_ssl_cbs(), cl); 851 efl_event_callback_array_add(inner_socket, _ecore_con_client_socket_ssl_cbs(), cl);
@@ -1626,7 +1624,6 @@ _ecore_con_server_server_ssl_job(void *data, const Eina_Value v,
1626 efl_parent_set(inner_server, server); 1624 efl_parent_set(inner_server, server);
1627 1625
1628 efl_unref(ssl_ctx); /* inner_server keeps it */ 1626 efl_unref(ssl_ctx); /* inner_server keeps it */
1629 efl_unref(inner_server); /* server keeps it */
1630 1627
1631 if (!_ecore_con_server_server_set(svr, server)) 1628 if (!_ecore_con_server_server_set(svr, server))
1632 goto error_serve; 1629 goto error_serve;
@@ -1852,7 +1849,7 @@ _ecore_con_server_dialer_set(Ecore_Con_Server *svr, Eo *dialer)
1852 1849
1853 svr->dialer = dialer; 1850 svr->dialer = dialer;
1854 efl_io_closer_close_on_exec_set(dialer, EINA_TRUE); 1851 efl_io_closer_close_on_exec_set(dialer, EINA_TRUE);
1855 efl_io_closer_close_on_destructor_set(dialer, EINA_TRUE); 1852 efl_io_closer_close_on_invalidate_set(dialer, EINA_TRUE);
1856 efl_io_buffered_stream_timeout_inactivity_set(dialer, svr->timeout); 1853 efl_io_buffered_stream_timeout_inactivity_set(dialer, svr->timeout);
1857 efl_event_callback_array_add(dialer, _ecore_con_server_dialer_cbs(), svr); 1854 efl_event_callback_array_add(dialer, _ecore_con_server_dialer_cbs(), svr);
1858 1855
@@ -1993,7 +1990,6 @@ _ecore_con_server_dialer_ssl_job(void *data, const Eina_Value v,
1993 efl_parent_set(inner_dialer, dialer); 1990 efl_parent_set(inner_dialer, dialer);
1994 1991
1995 efl_unref(ssl_ctx); /* inner_dialer keeps it */ 1992 efl_unref(ssl_ctx); /* inner_dialer keeps it */
1996 efl_unref(inner_dialer); /* dialer keeps it */
1997 1993
1998 if (!_ecore_con_server_dialer_set(svr, dialer)) 1994 if (!_ecore_con_server_dialer_set(svr, dialer))
1999 goto error_dial; 1995 goto error_dial;
@@ -2092,11 +2088,10 @@ _ecore_con_server_dialer_ssl_upgrade_job(void *data, const Eina_Value v,
2092 efl_parent_set(inner_dialer, dialer); 2088 efl_parent_set(inner_dialer, dialer);
2093 2089
2094 efl_unref(ssl_ctx); /* inner_dialer keeps it */ 2090 efl_unref(ssl_ctx); /* inner_dialer keeps it */
2095 efl_unref(inner_dialer); /* dialer keeps it */
2096 2091
2097 svr->dialer = dialer; 2092 svr->dialer = dialer;
2098 efl_io_closer_close_on_exec_set(dialer, EINA_TRUE); 2093 efl_io_closer_close_on_exec_set(dialer, EINA_TRUE);
2099 efl_io_closer_close_on_destructor_set(dialer, EINA_TRUE); 2094 efl_io_closer_close_on_invalidate_set(dialer, EINA_TRUE);
2100 efl_event_callback_array_del(tcp_dialer, _ecore_con_server_dialer_cbs(), svr); 2095 efl_event_callback_array_del(tcp_dialer, _ecore_con_server_dialer_cbs(), svr);
2101 efl_event_callback_array_add(dialer, _ecore_con_server_dialer_cbs(), svr); 2096 efl_event_callback_array_add(dialer, _ecore_con_server_dialer_cbs(), svr);
2102 2097
diff --git a/src/lib/ecore_con/ecore_con_url.c b/src/lib/ecore_con/ecore_con_url.c
index 6a9d06d582..3c9faea28c 100644
--- a/src/lib/ecore_con/ecore_con_url.c
+++ b/src/lib/ecore_con/ecore_con_url.c
@@ -922,7 +922,7 @@ ecore_con_url_post(Ecore_Con_Url *url_con,
922 922
923 buffer = efl_add(EFL_IO_BUFFER_CLASS, efl_loop_get(url_con->dialer), 923 buffer = efl_add(EFL_IO_BUFFER_CLASS, efl_loop_get(url_con->dialer),
924 efl_name_set(efl_added, "post-buffer"), 924 efl_name_set(efl_added, "post-buffer"),
925 efl_io_closer_close_on_destructor_set(efl_added, EINA_TRUE), 925 efl_io_closer_close_on_invalidate_set(efl_added, EINA_TRUE),
926 efl_io_closer_close_on_exec_set(efl_added, EINA_TRUE)); 926 efl_io_closer_close_on_exec_set(efl_added, EINA_TRUE));
927 EINA_SAFETY_ON_NULL_GOTO(buffer, error_buffer); 927 EINA_SAFETY_ON_NULL_GOTO(buffer, error_buffer);
928 928
@@ -938,7 +938,7 @@ ecore_con_url_post(Ecore_Con_Url *url_con,
938 efl_name_set(efl_added, "send-copier"), 938 efl_name_set(efl_added, "send-copier"),
939 efl_io_copier_source_set(efl_added, buffer), 939 efl_io_copier_source_set(efl_added, buffer),
940 efl_io_copier_destination_set(efl_added, url_con->dialer), 940 efl_io_copier_destination_set(efl_added, url_con->dialer),
941 efl_io_closer_close_on_destructor_set(efl_added, EINA_FALSE), 941 efl_io_closer_close_on_invalidate_set(efl_added, EINA_FALSE),
942 efl_event_callback_array_add(efl_added, _ecore_con_url_copier_cbs(), url_con)); 942 efl_event_callback_array_add(efl_added, _ecore_con_url_copier_cbs(), url_con));
943 EINA_SAFETY_ON_NULL_GOTO(copier, error_copier); 943 EINA_SAFETY_ON_NULL_GOTO(copier, error_copier);
944 944
@@ -1179,7 +1179,7 @@ ecore_con_url_ftp_upload(Ecore_Con_Url *url_con,
1179 efl_name_set(efl_added, "upload-file"), 1179 efl_name_set(efl_added, "upload-file"),
1180 efl_file_set(efl_added, filename, NULL), 1180 efl_file_set(efl_added, filename, NULL),
1181 efl_io_file_flags_set(efl_added, O_RDONLY), 1181 efl_io_file_flags_set(efl_added, O_RDONLY),
1182 efl_io_closer_close_on_destructor_set(efl_added, EINA_TRUE), 1182 efl_io_closer_close_on_invalidate_set(efl_added, EINA_TRUE),
1183 efl_io_closer_close_on_exec_set(efl_added, EINA_TRUE)); 1183 efl_io_closer_close_on_exec_set(efl_added, EINA_TRUE));
1184 EINA_SAFETY_ON_NULL_GOTO(file, error_file); 1184 EINA_SAFETY_ON_NULL_GOTO(file, error_file);
1185 1185
@@ -1187,7 +1187,7 @@ ecore_con_url_ftp_upload(Ecore_Con_Url *url_con,
1187 efl_name_set(efl_added, "send-copier"), 1187 efl_name_set(efl_added, "send-copier"),
1188 efl_io_copier_source_set(efl_added, file), 1188 efl_io_copier_source_set(efl_added, file),
1189 efl_io_copier_destination_set(efl_added, url_con->dialer), 1189 efl_io_copier_destination_set(efl_added, url_con->dialer),
1190 efl_io_closer_close_on_destructor_set(efl_added, EINA_FALSE), 1190 efl_io_closer_close_on_invalidate_set(efl_added, EINA_FALSE),
1191 efl_event_callback_array_add(efl_added, _ecore_con_url_copier_cbs(), url_con)); 1191 efl_event_callback_array_add(efl_added, _ecore_con_url_copier_cbs(), url_con));
1192 EINA_SAFETY_ON_NULL_GOTO(copier, error_copier); 1192 EINA_SAFETY_ON_NULL_GOTO(copier, error_copier);
1193 1193
diff --git a/src/lib/ecore_con/efl_net_dialer_http.c b/src/lib/ecore_con/efl_net_dialer_http.c
index c31c0e4356..df1fedf61e 100644
--- a/src/lib/ecore_con/efl_net_dialer_http.c
+++ b/src/lib/ecore_con/efl_net_dialer_http.c
@@ -218,7 +218,7 @@ typedef struct
218 Eina_Bool connected; 218 Eina_Bool connected;
219 Eina_Bool closed; 219 Eina_Bool closed;
220 Eina_Bool close_on_exec; 220 Eina_Bool close_on_exec;
221 Eina_Bool close_on_destructor; 221 Eina_Bool close_on_invalidate;
222 Eina_Bool pending_eos; 222 Eina_Bool pending_eos;
223 Eina_Bool eos; 223 Eina_Bool eos;
224 Eina_Bool can_read; 224 Eina_Bool can_read;
@@ -1129,7 +1129,7 @@ _efl_net_dialer_http_efl_object_constructor(Eo *o, Efl_Net_Dialer_Http_Data *pd)
1129} 1129}
1130 1130
1131EOLIAN static void 1131EOLIAN static void
1132_efl_net_dialer_http_efl_object_destructor(Eo *o, Efl_Net_Dialer_Http_Data *pd) 1132_efl_net_dialer_http_efl_object_invalidate(Eo *o, Efl_Net_Dialer_Http_Data *pd)
1133{ 1133{
1134 if (pd->libproxy_thread) 1134 if (pd->libproxy_thread)
1135 { 1135 {
@@ -1149,7 +1149,7 @@ _efl_net_dialer_http_efl_object_destructor(Eo *o, Efl_Net_Dialer_Http_Data *pd)
1149 efl_io_closer_close(o); 1149 efl_io_closer_close(o);
1150 efl_event_thaw(o); 1150 efl_event_thaw(o);
1151 } 1151 }
1152 else if (efl_io_closer_close_on_destructor_get(o) && 1152 else if (efl_io_closer_close_on_invalidate_get(o) &&
1153 (!efl_io_closer_closed_get(o))) 1153 (!efl_io_closer_closed_get(o)))
1154 { 1154 {
1155 efl_event_freeze(o); 1155 efl_event_freeze(o);
@@ -1157,6 +1157,12 @@ _efl_net_dialer_http_efl_object_destructor(Eo *o, Efl_Net_Dialer_Http_Data *pd)
1157 efl_event_thaw(o); 1157 efl_event_thaw(o);
1158 } 1158 }
1159 1159
1160 efl_invalidate(efl_super(o, MY_CLASS));
1161}
1162
1163EOLIAN static void
1164_efl_net_dialer_http_efl_object_destructor(Eo *o, Efl_Net_Dialer_Http_Data *pd)
1165{
1160 efl_net_dialer_http_response_headers_clear(o); 1166 efl_net_dialer_http_response_headers_clear(o);
1161 1167
1162 if (pd->easy) 1168 if (pd->easy)
@@ -1806,15 +1812,15 @@ _efl_net_dialer_http_efl_io_closer_close_on_exec_get(const Eo *o EINA_UNUSED, Ef
1806} 1812}
1807 1813
1808EOLIAN static void 1814EOLIAN static void
1809_efl_net_dialer_http_efl_io_closer_close_on_destructor_set(Eo *o EINA_UNUSED, Efl_Net_Dialer_Http_Data *pd, Eina_Bool close_on_destructor) 1815_efl_net_dialer_http_efl_io_closer_close_on_invalidate_set(Eo *o EINA_UNUSED, Efl_Net_Dialer_Http_Data *pd, Eina_Bool close_on_invalidate)
1810{ 1816{
1811 pd->close_on_destructor = close_on_destructor; 1817 pd->close_on_invalidate = close_on_invalidate;
1812} 1818}
1813 1819
1814EOLIAN static Eina_Bool 1820EOLIAN static Eina_Bool
1815_efl_net_dialer_http_efl_io_closer_close_on_destructor_get(const Eo *o EINA_UNUSED, Efl_Net_Dialer_Http_Data *pd) 1821_efl_net_dialer_http_efl_io_closer_close_on_invalidate_get(const Eo *o EINA_UNUSED, Efl_Net_Dialer_Http_Data *pd)
1816{ 1822{
1817 return pd->close_on_destructor; 1823 return pd->close_on_invalidate;
1818} 1824}
1819 1825
1820EOLIAN static Eina_Error 1826EOLIAN static Eina_Error
diff --git a/src/lib/ecore_con/efl_net_dialer_http.eo b/src/lib/ecore_con/efl_net_dialer_http.eo
index faecaebd35..7aab27cefb 100644
--- a/src/lib/ecore_con/efl_net_dialer_http.eo
+++ b/src/lib/ecore_con/efl_net_dialer_http.eo
@@ -393,6 +393,7 @@ class Efl.Net.Dialer_Http (Efl.Loop_Consumer, Efl.Net.Dialer, Efl.Io.Sizer) {
393 393
394 implements { 394 implements {
395 Efl.Object.constructor; 395 Efl.Object.constructor;
396 Efl.Object.invalidate;
396 Efl.Object.destructor; 397 Efl.Object.destructor;
397 Efl.Net.Dialer.dial; 398 Efl.Net.Dialer.dial;
398 Efl.Net.Dialer.address_dial { get; set; } 399 Efl.Net.Dialer.address_dial { get; set; }
@@ -409,7 +410,7 @@ class Efl.Net.Dialer_Http (Efl.Loop_Consumer, Efl.Net.Dialer, Efl.Io.Sizer) {
409 Efl.Io.Closer.close; 410 Efl.Io.Closer.close;
410 Efl.Io.Closer.closed { get; } 411 Efl.Io.Closer.closed { get; }
411 Efl.Io.Closer.close_on_exec { get; set; } 412 Efl.Io.Closer.close_on_exec { get; set; }
412 Efl.Io.Closer.close_on_destructor { get; set; } 413 Efl.Io.Closer.close_on_invalidate { get; set; }
413 Efl.Io.Sizer.resize; 414 Efl.Io.Sizer.resize;
414 Efl.Io.Sizer.size { get; } 415 Efl.Io.Sizer.size { get; }
415 } 416 }
diff --git a/src/lib/ecore_con/efl_net_dialer_simple.c b/src/lib/ecore_con/efl_net_dialer_simple.c
index 8bf7b169a6..8d25c370e2 100644
--- a/src/lib/ecore_con/efl_net_dialer_simple.c
+++ b/src/lib/ecore_con/efl_net_dialer_simple.c
@@ -48,6 +48,7 @@ static void
48_efl_net_dialer_simple_inner_io_connected(void *data, const Efl_Event *event) 48_efl_net_dialer_simple_inner_io_connected(void *data, const Efl_Event *event)
49{ 49{
50 Eo *o = data; 50 Eo *o = data;
51
51 efl_event_callback_call(o, EFL_NET_DIALER_EVENT_CONNECTED, event->info); 52 efl_event_callback_call(o, EFL_NET_DIALER_EVENT_CONNECTED, event->info);
52} 53}
53 54
@@ -87,10 +88,24 @@ _efl_net_dialer_simple_efl_object_finalize(Eo *o, Efl_Net_Dialer_Simple_Data *pd
87} 88}
88 89
89EOLIAN static void 90EOLIAN static void
90_efl_net_dialer_simple_efl_object_destructor(Eo *o, Efl_Net_Dialer_Simple_Data *pd) 91_efl_net_dialer_simple_efl_object_invalidate(Eo *o, Efl_Net_Dialer_Simple_Data *pd EINA_UNUSED)
91{ 92{
92 Eo *inner_io; 93 Eo *inner_io;
93 94
95 inner_io = efl_io_buffered_stream_inner_io_get(o);
96 if (inner_io)
97 {
98 efl_event_callback_array_del(inner_io, _efl_net_dialer_simple_inner_io_cbs(), o);
99 if (efl_parent_get(inner_io) == o)
100 efl_parent_set(inner_io, NULL);
101 }
102
103 efl_invalidate(efl_super(o, EFL_NET_DIALER_SIMPLE_CLASS));
104}
105
106EOLIAN static void
107_efl_net_dialer_simple_efl_object_destructor(Eo *o, Efl_Net_Dialer_Simple_Data *pd)
108{
94 if (pd->inner_class) pd->inner_class = NULL; 109 if (pd->inner_class) pd->inner_class = NULL;
95 110
96 eina_stringshare_replace(&pd->proxy_url, NULL); 111 eina_stringshare_replace(&pd->proxy_url, NULL);
@@ -100,14 +115,6 @@ _efl_net_dialer_simple_efl_object_destructor(Eo *o, Efl_Net_Dialer_Simple_Data *
100 pd->line_delimiter.mem = NULL; 115 pd->line_delimiter.mem = NULL;
101 } 116 }
102 117
103 inner_io = efl_io_buffered_stream_inner_io_get(o);
104 if (inner_io)
105 {
106 efl_event_callback_array_del(inner_io, _efl_net_dialer_simple_inner_io_cbs(), o);
107 if (efl_parent_get(inner_io) == o)
108 efl_parent_set(inner_io, NULL);
109 }
110
111 efl_destructor(efl_super(o, EFL_NET_DIALER_SIMPLE_CLASS)); 118 efl_destructor(efl_super(o, EFL_NET_DIALER_SIMPLE_CLASS));
112} 119}
113 120
diff --git a/src/lib/ecore_con/efl_net_dialer_simple.eo b/src/lib/ecore_con/efl_net_dialer_simple.eo
index e1e6522f68..38ec878808 100644
--- a/src/lib/ecore_con/efl_net_dialer_simple.eo
+++ b/src/lib/ecore_con/efl_net_dialer_simple.eo
@@ -69,6 +69,7 @@ class Efl.Net.Dialer_Simple (Efl.Net.Socket_Simple, Efl.Net.Dialer) {
69 69
70 implements { 70 implements {
71 Efl.Object.finalize; 71 Efl.Object.finalize;
72 Efl.Object.invalidate;
72 Efl.Object.destructor; 73 Efl.Object.destructor;
73 Efl.Io.Buffered_Stream.inner_io { set; } 74 Efl.Io.Buffered_Stream.inner_io { set; }
74 Efl.Net.Dialer.dial; 75 Efl.Net.Dialer.dial;
diff --git a/src/lib/ecore_con/efl_net_dialer_ssl.c b/src/lib/ecore_con/efl_net_dialer_ssl.c
index 4ecfc03530..9a89ea90d2 100644
--- a/src/lib/ecore_con/efl_net_dialer_ssl.c
+++ b/src/lib/ecore_con/efl_net_dialer_ssl.c
@@ -98,13 +98,7 @@ _efl_net_dialer_ssl_efl_object_invalidate(Eo *o, Efl_Net_Dialer_Ssl_Data *pd)
98{ 98{
99 pd->sock = NULL; 99 pd->sock = NULL;
100 100
101 efl_invalidate(efl_super(o, MY_CLASS)); 101 if (efl_io_closer_close_on_invalidate_get(o) &&
102}
103
104EOLIAN static void
105_efl_net_dialer_ssl_efl_object_destructor(Eo *o, Efl_Net_Dialer_Ssl_Data *pd)
106{
107 if (efl_io_closer_close_on_destructor_get(o) &&
108 (!efl_io_closer_closed_get(o))) 102 (!efl_io_closer_closed_get(o)))
109 { 103 {
110 efl_event_freeze(o); 104 efl_event_freeze(o);
@@ -118,7 +112,7 @@ _efl_net_dialer_ssl_efl_object_destructor(Eo *o, Efl_Net_Dialer_Ssl_Data *pd)
118 pd->ssl_ctx = NULL; 112 pd->ssl_ctx = NULL;
119 } 113 }
120 114
121 efl_destructor(efl_super(o, MY_CLASS)); 115 efl_invalidate(efl_super(o, MY_CLASS));
122} 116}
123 117
124EOLIAN static void 118EOLIAN static void
diff --git a/src/lib/ecore_con/efl_net_dialer_ssl.eo b/src/lib/ecore_con/efl_net_dialer_ssl.eo
index 7a9ffe5cd0..c732e1c621 100644
--- a/src/lib/ecore_con/efl_net_dialer_ssl.eo
+++ b/src/lib/ecore_con/efl_net_dialer_ssl.eo
@@ -68,7 +68,6 @@ class Efl.Net.Dialer_Ssl (Efl.Net.Socket_Ssl, Efl.Net.Dialer) {
68 Efl.Object.constructor; 68 Efl.Object.constructor;
69 Efl.Object.finalize; 69 Efl.Object.finalize;
70 Efl.Object.invalidate; 70 Efl.Object.invalidate;
71 Efl.Object.destructor;
72 Efl.Net.Dialer.dial; 71 Efl.Net.Dialer.dial;
73 Efl.Net.Dialer.address_dial { get; } 72 Efl.Net.Dialer.address_dial { get; }
74 Efl.Net.Dialer.connected { get; set; } 73 Efl.Net.Dialer.connected { get; set; }
diff --git a/src/lib/ecore_con/efl_net_dialer_tcp.c b/src/lib/ecore_con/efl_net_dialer_tcp.c
index 88f1bb7bb8..12e24b7238 100644
--- a/src/lib/ecore_con/efl_net_dialer_tcp.c
+++ b/src/lib/ecore_con/efl_net_dialer_tcp.c
@@ -53,9 +53,9 @@ _efl_net_dialer_tcp_efl_object_constructor(Eo *o, Efl_Net_Dialer_Tcp_Data *pd EI
53} 53}
54 54
55EOLIAN static void 55EOLIAN static void
56_efl_net_dialer_tcp_efl_object_destructor(Eo *o, Efl_Net_Dialer_Tcp_Data *pd) 56_efl_net_dialer_tcp_efl_object_invalidate(Eo *o, Efl_Net_Dialer_Tcp_Data *pd)
57{ 57{
58 if (efl_io_closer_close_on_destructor_get(o) && 58 if (efl_io_closer_close_on_invalidate_get(o) &&
59 (!efl_io_closer_closed_get(o))) 59 (!efl_io_closer_closed_get(o)))
60 { 60 {
61 efl_event_freeze(o); 61 efl_event_freeze(o);
@@ -69,6 +69,12 @@ _efl_net_dialer_tcp_efl_object_destructor(Eo *o, Efl_Net_Dialer_Tcp_Data *pd)
69 pd->connect.thread = NULL; 69 pd->connect.thread = NULL;
70 } 70 }
71 71
72 efl_invalidate(efl_super(o, MY_CLASS));
73}
74
75EOLIAN static void
76_efl_net_dialer_tcp_efl_object_destructor(Eo *o, Efl_Net_Dialer_Tcp_Data *pd)
77{
72 efl_destructor(efl_super(o, MY_CLASS)); 78 efl_destructor(efl_super(o, MY_CLASS));
73 79
74 eina_stringshare_replace(&pd->address_dial, NULL); 80 eina_stringshare_replace(&pd->address_dial, NULL);
diff --git a/src/lib/ecore_con/efl_net_dialer_tcp.eo b/src/lib/ecore_con/efl_net_dialer_tcp.eo
index c46084b151..757e926ab5 100644
--- a/src/lib/ecore_con/efl_net_dialer_tcp.eo
+++ b/src/lib/ecore_con/efl_net_dialer_tcp.eo
@@ -24,6 +24,7 @@ class Efl.Net.Dialer_Tcp (Efl.Net.Socket_Tcp, Efl.Net.Dialer) {
24 24
25 implements { 25 implements {
26 Efl.Object.constructor; 26 Efl.Object.constructor;
27 Efl.Object.invalidate;
27 Efl.Object.destructor; 28 Efl.Object.destructor;
28 Efl.Net.Dialer.dial; 29 Efl.Net.Dialer.dial;
29 Efl.Net.Dialer.address_dial { get; set; } 30 Efl.Net.Dialer.address_dial { get; set; }
diff --git a/src/lib/ecore_con/efl_net_dialer_udp.c b/src/lib/ecore_con/efl_net_dialer_udp.c
index 1c7eda3fd1..89a7154710 100644
--- a/src/lib/ecore_con/efl_net_dialer_udp.c
+++ b/src/lib/ecore_con/efl_net_dialer_udp.c
@@ -54,9 +54,9 @@ _efl_net_dialer_udp_efl_object_constructor(Eo *o, Efl_Net_Dialer_Udp_Data *pd EI
54} 54}
55 55
56EOLIAN static void 56EOLIAN static void
57_efl_net_dialer_udp_efl_object_destructor(Eo *o, Efl_Net_Dialer_Udp_Data *pd) 57_efl_net_dialer_udp_efl_object_invalidate(Eo *o, Efl_Net_Dialer_Udp_Data *pd)
58{ 58{
59 if (efl_io_closer_close_on_destructor_get(o) && 59 if (efl_io_closer_close_on_invalidate_get(o) &&
60 (!efl_io_closer_closed_get(o))) 60 (!efl_io_closer_closed_get(o)))
61 { 61 {
62 efl_event_freeze(o); 62 efl_event_freeze(o);
@@ -70,6 +70,12 @@ _efl_net_dialer_udp_efl_object_destructor(Eo *o, Efl_Net_Dialer_Udp_Data *pd)
70 pd->resolver.thread = NULL; 70 pd->resolver.thread = NULL;
71 } 71 }
72 72
73 efl_invalidate(efl_super(o, MY_CLASS));
74}
75
76EOLIAN static void
77_efl_net_dialer_udp_efl_object_destructor(Eo *o, Efl_Net_Dialer_Udp_Data *pd)
78{
73 efl_destructor(efl_super(o, MY_CLASS)); 79 efl_destructor(efl_super(o, MY_CLASS));
74 80
75 eina_stringshare_replace(&pd->address_dial, NULL); 81 eina_stringshare_replace(&pd->address_dial, NULL);
diff --git a/src/lib/ecore_con/efl_net_dialer_udp.eo b/src/lib/ecore_con/efl_net_dialer_udp.eo
index 56f34413af..4e5a407015 100644
--- a/src/lib/ecore_con/efl_net_dialer_udp.eo
+++ b/src/lib/ecore_con/efl_net_dialer_udp.eo
@@ -27,6 +27,7 @@ class Efl.Net.Dialer_Udp (Efl.Net.Socket_Udp, Efl.Net.Dialer) {
27 27
28 implements { 28 implements {
29 Efl.Object.constructor; 29 Efl.Object.constructor;
30 Efl.Object.invalidate;
30 Efl.Object.destructor; 31 Efl.Object.destructor;
31 Efl.Net.Dialer.dial; 32 Efl.Net.Dialer.dial;
32 Efl.Net.Dialer.address_dial { get; set; } 33 Efl.Net.Dialer.address_dial { get; set; }
diff --git a/src/lib/ecore_con/efl_net_dialer_unix.c b/src/lib/ecore_con/efl_net_dialer_unix.c
index 9c20bf19c6..683a37b89f 100644
--- a/src/lib/ecore_con/efl_net_dialer_unix.c
+++ b/src/lib/ecore_con/efl_net_dialer_unix.c
@@ -43,9 +43,9 @@ _efl_net_dialer_unix_efl_object_constructor(Eo *o, Efl_Net_Dialer_Unix_Data *pd
43} 43}
44 44
45EOLIAN static void 45EOLIAN static void
46_efl_net_dialer_unix_efl_object_destructor(Eo *o, Efl_Net_Dialer_Unix_Data *pd) 46_efl_net_dialer_unix_efl_object_invalidate(Eo *o, Efl_Net_Dialer_Unix_Data *pd)
47{ 47{
48 if (efl_io_closer_close_on_destructor_get(o) && 48 if (efl_io_closer_close_on_invalidate_get(o) &&
49 (!efl_io_closer_closed_get(o))) 49 (!efl_io_closer_closed_get(o)))
50 { 50 {
51 efl_event_freeze(o); 51 efl_event_freeze(o);
@@ -59,6 +59,12 @@ _efl_net_dialer_unix_efl_object_destructor(Eo *o, Efl_Net_Dialer_Unix_Data *pd)
59 pd->connect.thread = NULL; 59 pd->connect.thread = NULL;
60 } 60 }
61 61
62 efl_invalidate(efl_super(o, MY_CLASS));
63}
64
65EOLIAN static void
66_efl_net_dialer_unix_efl_object_destructor(Eo *o, Efl_Net_Dialer_Unix_Data *pd)
67{
62 efl_destructor(efl_super(o, MY_CLASS)); 68 efl_destructor(efl_super(o, MY_CLASS));
63 69
64 eina_stringshare_replace(&pd->address_dial, NULL); 70 eina_stringshare_replace(&pd->address_dial, NULL);
diff --git a/src/lib/ecore_con/efl_net_dialer_unix.eo b/src/lib/ecore_con/efl_net_dialer_unix.eo
index aafe27fdf6..a45d2be5c7 100644
--- a/src/lib/ecore_con/efl_net_dialer_unix.eo
+++ b/src/lib/ecore_con/efl_net_dialer_unix.eo
@@ -12,6 +12,7 @@ class Efl.Net.Dialer_Unix (Efl.Net.Socket_Unix, Efl.Net.Dialer) {
12 12
13 implements { 13 implements {
14 Efl.Object.constructor; 14 Efl.Object.constructor;
15 Efl.Object.invalidate;
15 Efl.Object.destructor; 16 Efl.Object.destructor;
16 Efl.Net.Dialer.dial; 17 Efl.Net.Dialer.dial;
17 Efl.Net.Dialer.address_dial { get; set; } 18 Efl.Net.Dialer.address_dial { get; set; }
diff --git a/src/lib/ecore_con/efl_net_dialer_websocket.c b/src/lib/ecore_con/efl_net_dialer_websocket.c
index 79e03f08cc..80c598ac4b 100644
--- a/src/lib/ecore_con/efl_net_dialer_websocket.c
+++ b/src/lib/ecore_con/efl_net_dialer_websocket.c
@@ -1374,15 +1374,15 @@ _efl_net_dialer_websocket_efl_io_closer_close_on_exec_get(const Eo *o EINA_UNUSE
1374} 1374}
1375 1375
1376EOLIAN static void 1376EOLIAN static void
1377_efl_net_dialer_websocket_efl_io_closer_close_on_destructor_set(Eo *o EINA_UNUSED, Efl_Net_Dialer_Websocket_Data *pd, Eina_Bool close_on_destructor) 1377_efl_net_dialer_websocket_efl_io_closer_close_on_invalidate_set(Eo *o EINA_UNUSED, Efl_Net_Dialer_Websocket_Data *pd, Eina_Bool close_on_invalidate)
1378{ 1378{
1379 efl_io_closer_close_on_destructor_set(pd->http, close_on_destructor); 1379 efl_io_closer_close_on_invalidate_set(pd->http, close_on_invalidate);
1380} 1380}
1381 1381
1382EOLIAN static Eina_Bool 1382EOLIAN static Eina_Bool
1383_efl_net_dialer_websocket_efl_io_closer_close_on_destructor_get(const Eo *o EINA_UNUSED, Efl_Net_Dialer_Websocket_Data *pd) 1383_efl_net_dialer_websocket_efl_io_closer_close_on_invalidate_get(const Eo *o EINA_UNUSED, Efl_Net_Dialer_Websocket_Data *pd)
1384{ 1384{
1385 return efl_io_closer_close_on_destructor_get(pd->http); 1385 return efl_io_closer_close_on_invalidate_get(pd->http);
1386} 1386}
1387 1387
1388EOLIAN static void 1388EOLIAN static void
diff --git a/src/lib/ecore_con/efl_net_dialer_websocket.eo b/src/lib/ecore_con/efl_net_dialer_websocket.eo
index a994e590c2..f22bf54104 100644
--- a/src/lib/ecore_con/efl_net_dialer_websocket.eo
+++ b/src/lib/ecore_con/efl_net_dialer_websocket.eo
@@ -331,6 +331,6 @@ class Efl.Net.Dialer_Websocket (Efl.Loop_Consumer, Efl.Net.Dialer) {
331 Efl.Io.Closer.close; 331 Efl.Io.Closer.close;
332 Efl.Io.Closer.closed { get; } 332 Efl.Io.Closer.closed { get; }
333 Efl.Io.Closer.close_on_exec { get; set; } 333 Efl.Io.Closer.close_on_exec { get; set; }
334 Efl.Io.Closer.close_on_destructor { get; set; } 334 Efl.Io.Closer.close_on_invalidate { get; set; }
335 } 335 }
336} 336}
diff --git a/src/lib/ecore_con/efl_net_server_simple.c b/src/lib/ecore_con/efl_net_server_simple.c
index 4dec2200fb..8c0c4a6732 100644
--- a/src/lib/ecore_con/efl_net_server_simple.c
+++ b/src/lib/ecore_con/efl_net_server_simple.c
@@ -161,10 +161,8 @@ _efl_net_server_simple_efl_object_invalidate(Eo *o, Efl_Net_Server_Simple_Data *
161 if (pd->inner_server) 161 if (pd->inner_server)
162 { 162 {
163 efl_event_callback_array_del(pd->inner_server, _efl_net_server_simple_inner_server_cbs(), o); 163 efl_event_callback_array_del(pd->inner_server, _efl_net_server_simple_inner_server_cbs(), o);
164 if (efl_parent_get(pd->inner_server) == o)
165 efl_parent_set(pd->inner_server, NULL);
166 164
167 efl_unref(pd->inner_server); 165 efl_xunref(pd->inner_server, o);
168 pd->inner_server = NULL; 166 pd->inner_server = NULL;
169 } 167 }
170 168
@@ -232,7 +230,7 @@ _efl_net_server_simple_inner_server_set(Eo *o, Efl_Net_Server_Simple_Data *pd, E
232 EINA_SAFETY_ON_TRUE_RETURN(pd->inner_server != NULL); 230 EINA_SAFETY_ON_TRUE_RETURN(pd->inner_server != NULL);
233 EINA_SAFETY_ON_FALSE_RETURN(efl_isa(server, EFL_NET_SERVER_INTERFACE)); 231 EINA_SAFETY_ON_FALSE_RETURN(efl_isa(server, EFL_NET_SERVER_INTERFACE));
234 232
235 pd->inner_server = efl_ref(server); 233 pd->inner_server = efl_xref(server, o);
236 efl_event_callback_array_add(server, _efl_net_server_simple_inner_server_cbs(), o); 234 efl_event_callback_array_add(server, _efl_net_server_simple_inner_server_cbs(), o);
237 DBG("%p inner_server=%p (%s)", o, server, efl_class_name_get(efl_class_get(server))); 235 DBG("%p inner_server=%p (%s)", o, server, efl_class_name_get(efl_class_get(server)));
238} 236}
diff --git a/src/lib/ecore_con/efl_net_server_ssl.c b/src/lib/ecore_con/efl_net_server_ssl.c
index 7315484b1c..c865e7d0ab 100644
--- a/src/lib/ecore_con/efl_net_server_ssl.c
+++ b/src/lib/ecore_con/efl_net_server_ssl.c
@@ -89,7 +89,7 @@ _efl_net_server_ssl_efl_net_server_fd_client_add(Eo *o, Efl_Net_Server_Ssl_Data
89 89
90 client_tcp = efl_add(EFL_NET_SOCKET_TCP_CLASS, o, 90 client_tcp = efl_add(EFL_NET_SOCKET_TCP_CLASS, o,
91 efl_io_closer_close_on_exec_set(efl_added, efl_net_server_fd_close_on_exec_get(o)), 91 efl_io_closer_close_on_exec_set(efl_added, efl_net_server_fd_close_on_exec_get(o)),
92 efl_io_closer_close_on_destructor_set(efl_added, EINA_TRUE), 92 efl_io_closer_close_on_invalidate_set(efl_added, EINA_TRUE),
93 efl_loop_fd_set(efl_added, client_fd)); 93 efl_loop_fd_set(efl_added, client_fd));
94 if (!client_tcp) 94 if (!client_tcp)
95 { 95 {
diff --git a/src/lib/ecore_con/efl_net_server_tcp.c b/src/lib/ecore_con/efl_net_server_tcp.c
index b56984f853..e4e5bcb377 100644
--- a/src/lib/ecore_con/efl_net_server_tcp.c
+++ b/src/lib/ecore_con/efl_net_server_tcp.c
@@ -253,7 +253,7 @@ _efl_net_server_tcp_efl_net_server_fd_client_add(Eo *o, Efl_Net_Server_Tcp_Data
253{ 253{
254 Eo *client = efl_add(EFL_NET_SOCKET_TCP_CLASS, o, 254 Eo *client = efl_add(EFL_NET_SOCKET_TCP_CLASS, o,
255 efl_io_closer_close_on_exec_set(efl_added, efl_net_server_fd_close_on_exec_get(o)), 255 efl_io_closer_close_on_exec_set(efl_added, efl_net_server_fd_close_on_exec_get(o)),
256 efl_io_closer_close_on_destructor_set(efl_added, EINA_TRUE), 256 efl_io_closer_close_on_invalidate_set(efl_added, EINA_TRUE),
257 efl_loop_fd_set(efl_added, client_fd)); 257 efl_loop_fd_set(efl_added, client_fd));
258 if (!client) 258 if (!client)
259 { 259 {
diff --git a/src/lib/ecore_con/efl_net_server_udp.c b/src/lib/ecore_con/efl_net_server_udp.c
index 674945ec86..ced3e04662 100644
--- a/src/lib/ecore_con/efl_net_server_udp.c
+++ b/src/lib/ecore_con/efl_net_server_udp.c
@@ -369,7 +369,7 @@ _efl_net_server_udp_efl_net_server_fd_process_incoming_data(Eo *o, Efl_Net_Serve
369 } 369 }
370 370
371 client = efl_add(EFL_NET_SERVER_UDP_CLIENT_CLASS, o, 371 client = efl_add(EFL_NET_SERVER_UDP_CLIENT_CLASS, o,
372 efl_io_closer_close_on_destructor_set(efl_added, EINA_TRUE), 372 efl_io_closer_close_on_invalidate_set(efl_added, EINA_TRUE),
373 373
374 efl_net_socket_address_local_set(efl_added, efl_net_server_address_get(o)), 374 efl_net_socket_address_local_set(efl_added, efl_net_server_address_get(o)),
375 _efl_net_server_udp_client_init(efl_added, fd, (const struct sockaddr *)&addr, addrlen, str), 375 _efl_net_server_udp_client_init(efl_added, fd, (const struct sockaddr *)&addr, addrlen, str),
diff --git a/src/lib/ecore_con/efl_net_server_udp_client.c b/src/lib/ecore_con/efl_net_server_udp_client.c
index 33d4716269..52a9d38008 100644
--- a/src/lib/ecore_con/efl_net_server_udp_client.c
+++ b/src/lib/ecore_con/efl_net_server_udp_client.c
@@ -42,7 +42,7 @@ typedef struct _Efl_Net_Server_Udp_Client_Data
42 struct sockaddr *addr_remote; 42 struct sockaddr *addr_remote;
43 socklen_t addr_remote_len; 43 socklen_t addr_remote_len;
44 SOCKET fd; 44 SOCKET fd;
45 Eina_Bool close_on_destructor; 45 Eina_Bool close_on_invalidate;
46 Eina_Bool eos; 46 Eina_Bool eos;
47 Eina_Bool can_read; 47 Eina_Bool can_read;
48 Eina_Bool can_write; 48 Eina_Bool can_write;
@@ -71,9 +71,9 @@ _efl_net_server_udp_client_cleanup(Efl_Net_Server_Udp_Client_Data *pd)
71} 71}
72 72
73EOLIAN static void 73EOLIAN static void
74_efl_net_server_udp_client_efl_object_destructor(Eo *o, Efl_Net_Server_Udp_Client_Data *pd) 74_efl_net_server_udp_client_efl_object_invalidate(Eo *o, Efl_Net_Server_Udp_Client_Data *pd EINA_UNUSED)
75{ 75{
76 if (efl_io_closer_close_on_destructor_get(o) && 76 if (efl_io_closer_close_on_invalidate_get(o) &&
77 (!efl_io_closer_closed_get(o))) 77 (!efl_io_closer_closed_get(o)))
78 { 78 {
79 efl_event_freeze(o); 79 efl_event_freeze(o);
@@ -81,6 +81,12 @@ _efl_net_server_udp_client_efl_object_destructor(Eo *o, Efl_Net_Server_Udp_Clien
81 efl_event_thaw(o); 81 efl_event_thaw(o);
82 } 82 }
83 83
84 efl_invalidate(efl_super(o, MY_CLASS));
85}
86
87EOLIAN static void
88_efl_net_server_udp_client_efl_object_destructor(Eo *o, Efl_Net_Server_Udp_Client_Data *pd)
89{
84 efl_destructor(efl_super(o, MY_CLASS)); 90 efl_destructor(efl_super(o, MY_CLASS));
85 91
86 _efl_net_server_udp_client_cleanup(pd); 92 _efl_net_server_udp_client_cleanup(pd);
@@ -269,15 +275,15 @@ _efl_net_server_udp_client_efl_io_closer_closed_get(const Eo *o EINA_UNUSED, Efl
269} 275}
270 276
271EOLIAN static void 277EOLIAN static void
272_efl_net_server_udp_client_efl_io_closer_close_on_destructor_set(Eo *o EINA_UNUSED, Efl_Net_Server_Udp_Client_Data *pd, Eina_Bool close_on_destructor) 278_efl_net_server_udp_client_efl_io_closer_close_on_invalidate_set(Eo *o EINA_UNUSED, Efl_Net_Server_Udp_Client_Data *pd, Eina_Bool close_on_invalidate)
273{ 279{
274 pd->close_on_destructor = close_on_destructor; 280 pd->close_on_invalidate = close_on_invalidate;
275} 281}
276 282
277EOLIAN static Eina_Bool 283EOLIAN static Eina_Bool
278_efl_net_server_udp_client_efl_io_closer_close_on_destructor_get(const Eo *o EINA_UNUSED, Efl_Net_Server_Udp_Client_Data *pd) 284_efl_net_server_udp_client_efl_io_closer_close_on_invalidate_get(const Eo *o EINA_UNUSED, Efl_Net_Server_Udp_Client_Data *pd)
279{ 285{
280 return pd->close_on_destructor; 286 return pd->close_on_invalidate;
281} 287}
282 288
283EOLIAN static Eina_Bool 289EOLIAN static Eina_Bool
diff --git a/src/lib/ecore_con/efl_net_server_udp_client.eo b/src/lib/ecore_con/efl_net_server_udp_client.eo
index 12f5bbce4a..6eeeedef31 100644
--- a/src/lib/ecore_con/efl_net_server_udp_client.eo
+++ b/src/lib/ecore_con/efl_net_server_udp_client.eo
@@ -26,10 +26,11 @@ class Efl.Net.Server_Udp_Client (Efl.Object, Efl.Net.Socket) {
26 26
27 implements { 27 implements {
28 Efl.Object.finalize; 28 Efl.Object.finalize;
29 Efl.Object.invalidate;
29 Efl.Object.destructor; 30 Efl.Object.destructor;
30 Efl.Io.Closer.close; 31 Efl.Io.Closer.close;
31 Efl.Io.Closer.closed { get; } 32 Efl.Io.Closer.closed { get; }
32 Efl.Io.Closer.close_on_destructor { get; set; } 33 Efl.Io.Closer.close_on_invalidate { get; set; }
33 Efl.Io.Closer.close_on_exec { get; set; } 34 Efl.Io.Closer.close_on_exec { get; set; }
34 Efl.Io.Reader.can_read { get; set; } 35 Efl.Io.Reader.can_read { get; set; }
35 Efl.Io.Reader.eos { get; set; } 36 Efl.Io.Reader.eos { get; set; }
diff --git a/src/lib/ecore_con/efl_net_server_unix.c b/src/lib/ecore_con/efl_net_server_unix.c
index a0ab684858..38280c27c8 100644
--- a/src/lib/ecore_con/efl_net_server_unix.c
+++ b/src/lib/ecore_con/efl_net_server_unix.c
@@ -246,7 +246,7 @@ _efl_net_server_unix_efl_net_server_fd_client_add(Eo *o, Efl_Net_Server_Unix_Dat
246{ 246{
247 Eo *client = efl_add(EFL_NET_SOCKET_UNIX_CLASS, o, 247 Eo *client = efl_add(EFL_NET_SOCKET_UNIX_CLASS, o,
248 efl_io_closer_close_on_exec_set(efl_added, efl_net_server_fd_close_on_exec_get(o)), 248 efl_io_closer_close_on_exec_set(efl_added, efl_net_server_fd_close_on_exec_get(o)),
249 efl_io_closer_close_on_destructor_set(efl_added, EINA_TRUE), 249 efl_io_closer_close_on_invalidate_set(efl_added, EINA_TRUE),
250 efl_loop_fd_set(efl_added, client_fd)); 250 efl_loop_fd_set(efl_added, client_fd));
251 if (!client) 251 if (!client)
252 { 252 {
diff --git a/src/lib/ecore_con/efl_net_server_windows.c b/src/lib/ecore_con/efl_net_server_windows.c
index fc01728d42..1e0375ead1 100644
--- a/src/lib/ecore_con/efl_net_server_windows.c
+++ b/src/lib/ecore_con/efl_net_server_windows.c
@@ -231,7 +231,7 @@ _efl_net_server_windows_client_new(Eo *o, Efl_Net_Server_Windows_Data *pd)
231 } 231 }
232 232
233 pd->next_client = efl_add(EFL_NET_SOCKET_WINDOWS_CLASS, o, 233 pd->next_client = efl_add(EFL_NET_SOCKET_WINDOWS_CLASS, o,
234 efl_io_closer_close_on_destructor_set(efl_added, EINA_TRUE)); 234 efl_io_closer_close_on_invalidate_set(efl_added, EINA_TRUE));
235 if (!pd->next_client) 235 if (!pd->next_client)
236 { 236 {
237 err = ENOMEM; 237 err = ENOMEM;
diff --git a/src/lib/ecore_con/efl_net_socket_fd.c b/src/lib/ecore_con/efl_net_socket_fd.c
index 14c2142006..3ade365fc2 100644
--- a/src/lib/ecore_con/efl_net_socket_fd.c
+++ b/src/lib/ecore_con/efl_net_socket_fd.c
@@ -78,7 +78,7 @@ _efl_net_socket_fd_efl_object_constructor(Eo *o, Efl_Net_Socket_Fd_Data *pd)
78 o = efl_constructor(efl_super(o, MY_CLASS)); 78 o = efl_constructor(efl_super(o, MY_CLASS));
79 79
80 efl_io_closer_close_on_exec_set(o, EINA_TRUE); 80 efl_io_closer_close_on_exec_set(o, EINA_TRUE);
81 efl_io_closer_close_on_destructor_set(o, EINA_TRUE); 81 efl_io_closer_close_on_invalidate_set(o, EINA_TRUE);
82 efl_io_reader_fd_set(o, SOCKET_TO_LOOP_FD(INVALID_SOCKET)); 82 efl_io_reader_fd_set(o, SOCKET_TO_LOOP_FD(INVALID_SOCKET));
83 efl_io_writer_fd_set(o, SOCKET_TO_LOOP_FD(INVALID_SOCKET)); 83 efl_io_writer_fd_set(o, SOCKET_TO_LOOP_FD(INVALID_SOCKET));
84 efl_io_closer_fd_set(o, SOCKET_TO_LOOP_FD(INVALID_SOCKET)); 84 efl_io_closer_fd_set(o, SOCKET_TO_LOOP_FD(INVALID_SOCKET));
@@ -87,9 +87,9 @@ _efl_net_socket_fd_efl_object_constructor(Eo *o, Efl_Net_Socket_Fd_Data *pd)
87} 87}
88 88
89EOLIAN static void 89EOLIAN static void
90_efl_net_socket_fd_efl_object_destructor(Eo *o, Efl_Net_Socket_Fd_Data *pd) 90_efl_net_socket_fd_efl_object_invalidate(Eo *o, Efl_Net_Socket_Fd_Data *pd EINA_UNUSED)
91{ 91{
92 if (efl_io_closer_close_on_destructor_get(o) && 92 if (efl_io_closer_close_on_invalidate_get(o) &&
93 (!efl_io_closer_closed_get(o))) 93 (!efl_io_closer_closed_get(o)))
94 { 94 {
95 efl_event_freeze(o); 95 efl_event_freeze(o);
@@ -97,6 +97,12 @@ _efl_net_socket_fd_efl_object_destructor(Eo *o, Efl_Net_Socket_Fd_Data *pd)
97 efl_event_thaw(o); 97 efl_event_thaw(o);
98 } 98 }
99 99
100 efl_invalidate(efl_super(o, MY_CLASS));
101}
102
103EOLIAN static void
104_efl_net_socket_fd_efl_object_destructor(Eo *o, Efl_Net_Socket_Fd_Data *pd)
105{
100 efl_destructor(efl_super(o, MY_CLASS)); 106 efl_destructor(efl_super(o, MY_CLASS));
101 107
102 eina_stringshare_replace(&pd->address_local, NULL); 108 eina_stringshare_replace(&pd->address_local, NULL);
diff --git a/src/lib/ecore_con/efl_net_socket_fd.eo b/src/lib/ecore_con/efl_net_socket_fd.eo
index 8cce3ff318..951fe7f8cc 100644
--- a/src/lib/ecore_con/efl_net_socket_fd.eo
+++ b/src/lib/ecore_con/efl_net_socket_fd.eo
@@ -5,7 +5,7 @@ class Efl.Net.Socket_Fd (Efl.Loop_Fd, Efl.Io.Reader_Fd, Efl.Io.Writer_Fd, Efl.Io
5 created by an dialer or server. 5 created by an dialer or server.
6 6
7 @Efl.Io.Closer.close_on_exec and 7 @Efl.Io.Closer.close_on_exec and
8 @Efl.Io.Closer.close_on_destructor are respected and default to 8 @Efl.Io.Closer.close_on_invalidate are respected and default to
9 $true. 9 $true.
10 10
11 @since 1.19 11 @since 1.19
@@ -32,6 +32,7 @@ class Efl.Net.Socket_Fd (Efl.Loop_Fd, Efl.Io.Reader_Fd, Efl.Io.Writer_Fd, Efl.Io
32 implements { 32 implements {
33 Efl.Object.finalize; 33 Efl.Object.finalize;
34 Efl.Object.constructor; 34 Efl.Object.constructor;
35 Efl.Object.invalidate;
35 Efl.Object.destructor; 36 Efl.Object.destructor;
36 Efl.Loop_Fd.fd { set; } 37 Efl.Loop_Fd.fd { set; }
37 Efl.Io.Closer.close; 38 Efl.Io.Closer.close;
diff --git a/src/lib/ecore_con/efl_net_socket_ssl.c b/src/lib/ecore_con/efl_net_socket_ssl.c
index a281d0f722..b91f6649d3 100644
--- a/src/lib/ecore_con/efl_net_socket_ssl.c
+++ b/src/lib/ecore_con/efl_net_socket_ssl.c
@@ -445,9 +445,9 @@ _efl_net_socket_ssl_efl_object_constructor(Eo *o, Efl_Net_Socket_Ssl_Data *pd)
445} 445}
446 446
447EOLIAN static void 447EOLIAN static void
448_efl_net_socket_ssl_efl_object_destructor(Eo *o, Efl_Net_Socket_Ssl_Data *pd) 448_efl_net_socket_ssl_efl_object_invalidate(Eo *o, Efl_Net_Socket_Ssl_Data *pd EINA_UNUSED)
449{ 449{
450 if (efl_io_closer_close_on_destructor_get(o) && 450 if (efl_io_closer_close_on_invalidate_get(o) &&
451 (!efl_io_closer_closed_get(o))) 451 (!efl_io_closer_closed_get(o)))
452 { 452 {
453 efl_event_freeze(o); 453 efl_event_freeze(o);
@@ -455,6 +455,12 @@ _efl_net_socket_ssl_efl_object_destructor(Eo *o, Efl_Net_Socket_Ssl_Data *pd)
455 efl_event_thaw(o); 455 efl_event_thaw(o);
456 } 456 }
457 457
458 efl_invalidate(efl_super(o, MY_CLASS));
459}
460
461EOLIAN static void
462_efl_net_socket_ssl_efl_object_destructor(Eo *o, Efl_Net_Socket_Ssl_Data *pd)
463{
458 efl_destructor(efl_super(o, MY_CLASS)); 464 efl_destructor(efl_super(o, MY_CLASS));
459 465
460 pd->torndown = EINA_TRUE; 466 pd->torndown = EINA_TRUE;
@@ -617,15 +623,15 @@ _efl_net_socket_ssl_efl_io_closer_close_on_exec_get(const Eo *o EINA_UNUSED, Efl
617} 623}
618 624
619EOLIAN static void 625EOLIAN static void
620_efl_net_socket_ssl_efl_io_closer_close_on_destructor_set(Eo *o EINA_UNUSED, Efl_Net_Socket_Ssl_Data *pd, Eina_Bool close_on_destructor) 626_efl_net_socket_ssl_efl_io_closer_close_on_invalidate_set(Eo *o EINA_UNUSED, Efl_Net_Socket_Ssl_Data *pd, Eina_Bool close_on_invalidate)
621{ 627{
622 if (pd->sock) efl_io_closer_close_on_destructor_set(pd->sock, close_on_destructor); 628 if (pd->sock) efl_io_closer_close_on_invalidate_set(pd->sock, close_on_invalidate);
623} 629}
624 630
625EOLIAN static Eina_Bool 631EOLIAN static Eina_Bool
626_efl_net_socket_ssl_efl_io_closer_close_on_destructor_get(const Eo *o EINA_UNUSED, Efl_Net_Socket_Ssl_Data *pd) 632_efl_net_socket_ssl_efl_io_closer_close_on_invalidate_get(const Eo *o EINA_UNUSED, Efl_Net_Socket_Ssl_Data *pd)
627{ 633{
628 return pd->sock && efl_io_closer_close_on_destructor_get(pd->sock); 634 return pd->sock && efl_io_closer_close_on_invalidate_get(pd->sock);
629} 635}
630 636
631EOLIAN static const char * 637EOLIAN static const char *
diff --git a/src/lib/ecore_con/efl_net_socket_ssl.eo b/src/lib/ecore_con/efl_net_socket_ssl.eo
index 2e6ee11099..4f461814b3 100644
--- a/src/lib/ecore_con/efl_net_socket_ssl.eo
+++ b/src/lib/ecore_con/efl_net_socket_ssl.eo
@@ -84,12 +84,13 @@ class Efl.Net.Socket_Ssl (Efl.Loop_Consumer, Efl.Net.Socket) {
84 84
85 implements { 85 implements {
86 Efl.Object.constructor; 86 Efl.Object.constructor;
87 Efl.Object.destructor;
88 Efl.Object.finalize; 87 Efl.Object.finalize;
88 Efl.Object.invalidate;
89 Efl.Object.destructor;
89 Efl.Io.Closer.close; 90 Efl.Io.Closer.close;
90 Efl.Io.Closer.closed { get; } 91 Efl.Io.Closer.closed { get; }
91 Efl.Io.Closer.close_on_exec { get; set; } 92 Efl.Io.Closer.close_on_exec { get; set; }
92 Efl.Io.Closer.close_on_destructor { get; set; } 93 Efl.Io.Closer.close_on_invalidate { get; set; }
93 Efl.Io.Reader.read; 94 Efl.Io.Reader.read;
94 Efl.Io.Reader.can_read { get; set; } 95 Efl.Io.Reader.can_read { get; set; }
95 Efl.Io.Reader.eos { get; set; } 96 Efl.Io.Reader.eos { get; set; }
diff --git a/src/lib/ecore_con/efl_net_socket_windows.c b/src/lib/ecore_con/efl_net_socket_windows.c
index 33e166aea1..c69d0a8b6d 100644
--- a/src/lib/ecore_con/efl_net_socket_windows.c
+++ b/src/lib/ecore_con/efl_net_socket_windows.c
@@ -47,7 +47,7 @@ typedef struct _Efl_Net_Socket_Windows_Data
47 Eina_Bool can_write; 47 Eina_Bool can_write;
48 Eina_Bool io_started; 48 Eina_Bool io_started;
49 Eina_Bool close_on_exec; 49 Eina_Bool close_on_exec;
50 Eina_Bool close_on_destructor; 50 Eina_Bool close_on_invalidate;
51} Efl_Net_Socket_Windows_Data; 51} Efl_Net_Socket_Windows_Data;
52 52
53struct _Efl_Net_Socket_Windows_Operation 53struct _Efl_Net_Socket_Windows_Operation
@@ -634,9 +634,9 @@ _efl_net_socket_windows_efl_object_constructor(Eo *o, Efl_Net_Socket_Windows_Dat
634} 634}
635 635
636EOLIAN static void 636EOLIAN static void
637_efl_net_socket_windows_efl_object_destructor(Eo *o, Efl_Net_Socket_Windows_Data *pd) 637_efl_net_socket_windows_efl_object_invalidate(Eo *o, Efl_Net_Socket_Windows_Data *pd)
638{ 638{
639 if (efl_io_closer_close_on_destructor_get(o) && 639 if (efl_io_closer_close_on_invalidate_get(o) &&
640 (!efl_io_closer_closed_get(o))) 640 (!efl_io_closer_closed_get(o)))
641 { 641 {
642 efl_event_freeze(o); 642 efl_event_freeze(o);
@@ -644,6 +644,12 @@ _efl_net_socket_windows_efl_object_destructor(Eo *o, Efl_Net_Socket_Windows_Data
644 efl_event_thaw(o); 644 efl_event_thaw(o);
645 } 645 }
646 646
647 efl_invalidate(efl_super(o, MY_CLASS));
648}
649
650EOLIAN static void
651_efl_net_socket_windows_efl_object_destructor(Eo *o, Efl_Net_Socket_Windows_Data *pd)
652{
647 efl_destructor(efl_super(o, MY_CLASS)); 653 efl_destructor(efl_super(o, MY_CLASS));
648 654
649 eina_stringshare_replace(&pd->address_local, NULL); 655 eina_stringshare_replace(&pd->address_local, NULL);
@@ -748,15 +754,15 @@ _efl_net_socket_windows_efl_io_closer_close_on_exec_get(const Eo *o EINA_UNUSED,
748} 754}
749 755
750EOLIAN static void 756EOLIAN static void
751_efl_net_socket_windows_efl_io_closer_close_on_destructor_set(Eo *o EINA_UNUSED, Efl_Net_Socket_Windows_Data *pd, Eina_Bool close_on_destructor) 757_efl_net_socket_windows_efl_io_closer_close_on_invalidate_set(Eo *o EINA_UNUSED, Efl_Net_Socket_Windows_Data *pd, Eina_Bool close_on_invalidate)
752{ 758{
753 pd->close_on_destructor = close_on_destructor; 759 pd->close_on_invalidate = close_on_invalidate;
754} 760}
755 761
756EOLIAN static Eina_Bool 762EOLIAN static Eina_Bool
757_efl_net_socket_windows_efl_io_closer_close_on_destructor_get(const Eo *o EINA_UNUSED, Efl_Net_Socket_Windows_Data *pd) 763_efl_net_socket_windows_efl_io_closer_close_on_invalidate_get(const Eo *o EINA_UNUSED, Efl_Net_Socket_Windows_Data *pd)
758{ 764{
759 return pd->close_on_destructor; 765 return pd->close_on_invalidate;
760} 766}
761 767
762EOLIAN static Eina_Error 768EOLIAN static Eina_Error
diff --git a/src/lib/ecore_con/efl_net_socket_windows.eo b/src/lib/ecore_con/efl_net_socket_windows.eo
index 8df3b4c860..95cdea693c 100644
--- a/src/lib/ecore_con/efl_net_socket_windows.eo
+++ b/src/lib/ecore_con/efl_net_socket_windows.eo
@@ -14,7 +14,7 @@ class Efl.Net.Socket_Windows (Efl.Loop_Consumer, Efl.Net.Socket) {
14 Efl.Io.Closer.close; 14 Efl.Io.Closer.close;
15 Efl.Io.Closer.closed { get; } 15 Efl.Io.Closer.closed { get; }
16 Efl.Io.Closer.close_on_exec { get; set; } 16 Efl.Io.Closer.close_on_exec { get; set; }
17 Efl.Io.Closer.close_on_destructor { get; set; } 17 Efl.Io.Closer.close_on_invalidate { get; set; }
18 Efl.Io.Reader.read; 18 Efl.Io.Reader.read;
19 Efl.Io.Reader.can_read { get; set; } 19 Efl.Io.Reader.can_read { get; set; }
20 Efl.Io.Reader.eos { get; set; } 20 Efl.Io.Reader.eos { get; set; }