summaryrefslogtreecommitdiff
path: root/src/lib/ecore_con
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2018-04-09 17:01:21 -0700
committerCedric BAIL <cedric@osg.samsung.com>2018-05-01 10:39:01 -0700
commit57320c190fbe48031833dcd528553d2e6a8e146b (patch)
treefaa2a297d482e5170fcfdc558d0b04ea332864be /src/lib/ecore_con
parenta327a0e7c7251ab3479e39e0e415a2144593fb23 (diff)
ecore_con: if we rely on parent lifecycle for automatic destruction, do not call efl_del in the destructor.
Diffstat (limited to 'src/lib/ecore_con')
-rw-r--r--src/lib/ecore_con/efl_net_dialer_ssl.c14
-rw-r--r--src/lib/ecore_con/efl_net_dialer_ssl.eo3
-rw-r--r--src/lib/ecore_con/efl_net_dialer_websocket.c11
-rw-r--r--src/lib/ecore_con/efl_net_dialer_websocket.eo1
-rw-r--r--src/lib/ecore_con/efl_net_server_simple.c12
-rw-r--r--src/lib/ecore_con/efl_net_server_simple.eo2
-rw-r--r--src/lib/ecore_con/efl_net_server_ssl.c14
-rw-r--r--src/lib/ecore_con/efl_net_server_ssl.eo1
-rw-r--r--src/lib/ecore_con/efl_net_server_windows.c14
-rw-r--r--src/lib/ecore_con/efl_net_server_windows.eo1
10 files changed, 45 insertions, 28 deletions
diff --git a/src/lib/ecore_con/efl_net_dialer_ssl.c b/src/lib/ecore_con/efl_net_dialer_ssl.c
index b5a62c7b6b..4ecfc03530 100644
--- a/src/lib/ecore_con/efl_net_dialer_ssl.c
+++ b/src/lib/ecore_con/efl_net_dialer_ssl.c
@@ -94,6 +94,14 @@ _efl_net_dialer_ssl_efl_object_finalize(Eo *o, Efl_Net_Dialer_Ssl_Data *pd)
94} 94}
95 95
96EOLIAN static void 96EOLIAN static void
97_efl_net_dialer_ssl_efl_object_invalidate(Eo *o, Efl_Net_Dialer_Ssl_Data *pd)
98{
99 pd->sock = NULL;
100
101 efl_invalidate(efl_super(o, MY_CLASS));
102}
103
104EOLIAN static void
97_efl_net_dialer_ssl_efl_object_destructor(Eo *o, Efl_Net_Dialer_Ssl_Data *pd) 105_efl_net_dialer_ssl_efl_object_destructor(Eo *o, Efl_Net_Dialer_Ssl_Data *pd)
98{ 106{
99 if (efl_io_closer_close_on_destructor_get(o) && 107 if (efl_io_closer_close_on_destructor_get(o) &&
@@ -104,12 +112,6 @@ _efl_net_dialer_ssl_efl_object_destructor(Eo *o, Efl_Net_Dialer_Ssl_Data *pd)
104 efl_event_thaw(o); 112 efl_event_thaw(o);
105 } 113 }
106 114
107 if (pd->sock)
108 {
109 efl_del(pd->sock);
110 pd->sock = NULL;
111 }
112
113 if (pd->ssl_ctx) 115 if (pd->ssl_ctx)
114 { 116 {
115 efl_unref(pd->ssl_ctx); 117 efl_unref(pd->ssl_ctx);
diff --git a/src/lib/ecore_con/efl_net_dialer_ssl.eo b/src/lib/ecore_con/efl_net_dialer_ssl.eo
index ccff92d3dc..7a9ffe5cd0 100644
--- a/src/lib/ecore_con/efl_net_dialer_ssl.eo
+++ b/src/lib/ecore_con/efl_net_dialer_ssl.eo
@@ -66,8 +66,9 @@ class Efl.Net.Dialer_Ssl (Efl.Net.Socket_Ssl, Efl.Net.Dialer) {
66 66
67 implements { 67 implements {
68 Efl.Object.constructor; 68 Efl.Object.constructor;
69 Efl.Object.destructor;
70 Efl.Object.finalize; 69 Efl.Object.finalize;
70 Efl.Object.invalidate;
71 Efl.Object.destructor;
71 Efl.Net.Dialer.dial; 72 Efl.Net.Dialer.dial;
72 Efl.Net.Dialer.address_dial { get; } 73 Efl.Net.Dialer.address_dial { get; }
73 Efl.Net.Dialer.connected { get; set; } 74 Efl.Net.Dialer.connected { 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 4d9487de58..79e03f08cc 100644
--- a/src/lib/ecore_con/efl_net_dialer_websocket.c
+++ b/src/lib/ecore_con/efl_net_dialer_websocket.c
@@ -956,15 +956,20 @@ _efl_net_dialer_websocket_efl_object_constructor(Eo *o, Efl_Net_Dialer_Websocket
956} 956}
957 957
958EOLIAN static void 958EOLIAN static void
959_efl_net_dialer_websocket_efl_object_invalidate(Eo *o, Efl_Net_Dialer_Websocket_Data *pd)
960{
961 pd->http = NULL;
962
963 efl_invalidate(efl_super(o, MY_CLASS));
964}
965
966EOLIAN static void
959_efl_net_dialer_websocket_efl_object_destructor(Eo *o, Efl_Net_Dialer_Websocket_Data *pd) 967_efl_net_dialer_websocket_efl_object_destructor(Eo *o, Efl_Net_Dialer_Websocket_Data *pd)
960{ 968{
961 Eina_Stringshare *str; 969 Eina_Stringshare *str;
962 970
963 efl_event_callback_array_del(pd->http, _efl_net_dialer_websocket_http_cbs(), o); 971 efl_event_callback_array_del(pd->http, _efl_net_dialer_websocket_http_cbs(), o);
964 972
965 efl_del(pd->http);
966 pd->http = NULL;
967
968 efl_destructor(efl_super(o, MY_CLASS)); 973 efl_destructor(efl_super(o, MY_CLASS));
969 974
970 eina_stringshare_replace(&pd->address_dial, NULL); 975 eina_stringshare_replace(&pd->address_dial, NULL);
diff --git a/src/lib/ecore_con/efl_net_dialer_websocket.eo b/src/lib/ecore_con/efl_net_dialer_websocket.eo
index f38016cc4e..a994e590c2 100644
--- a/src/lib/ecore_con/efl_net_dialer_websocket.eo
+++ b/src/lib/ecore_con/efl_net_dialer_websocket.eo
@@ -314,6 +314,7 @@ class Efl.Net.Dialer_Websocket (Efl.Loop_Consumer, Efl.Net.Dialer) {
314 314
315 implements { 315 implements {
316 Efl.Object.constructor; 316 Efl.Object.constructor;
317 Efl.Object.invalidate;
317 Efl.Object.destructor; 318 Efl.Object.destructor;
318 Efl.Net.Dialer.dial; 319 Efl.Net.Dialer.dial;
319 Efl.Net.Dialer.address_dial { get; set; } 320 Efl.Net.Dialer.address_dial { get; set; }
diff --git a/src/lib/ecore_con/efl_net_server_simple.c b/src/lib/ecore_con/efl_net_server_simple.c
index d9b1b73178..4dec2200fb 100644
--- a/src/lib/ecore_con/efl_net_server_simple.c
+++ b/src/lib/ecore_con/efl_net_server_simple.c
@@ -149,7 +149,6 @@ _efl_net_server_simple_efl_object_finalize(Eo *o, Efl_Net_Server_Simple_Data *pd
149 DBG("created new inner server %p (%s)", server, efl_class_name_get(efl_class_get(server))); 149 DBG("created new inner server %p (%s)", server, efl_class_name_get(efl_class_get(server)));
150 150
151 efl_net_server_simple_inner_server_set(o, server); 151 efl_net_server_simple_inner_server_set(o, server);
152 efl_unref(server);
153 } 152 }
154 153
155 end: 154 end:
@@ -157,18 +156,21 @@ _efl_net_server_simple_efl_object_finalize(Eo *o, Efl_Net_Server_Simple_Data *pd
157} 156}
158 157
159EOLIAN static void 158EOLIAN static void
160_efl_net_server_simple_efl_object_destructor(Eo *o, Efl_Net_Server_Simple_Data *pd) 159_efl_net_server_simple_efl_object_invalidate(Eo *o, Efl_Net_Server_Simple_Data *pd)
161{ 160{
162 if (pd->inner_class) pd->inner_class = NULL;
163
164 if (pd->inner_server) 161 if (pd->inner_server)
165 { 162 {
166 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);
167 if (efl_parent_get(pd->inner_server) == o) 164 if (efl_parent_get(pd->inner_server) == o)
168 efl_parent_set(pd->inner_server, NULL); 165 efl_parent_set(pd->inner_server, NULL);
166
167 efl_unref(pd->inner_server);
168 pd->inner_server = NULL;
169 } 169 }
170 170
171 efl_destructor(efl_super(o, MY_CLASS)); 171 pd->inner_class = NULL;
172
173 efl_invalidate(efl_super(o, MY_CLASS));
172} 174}
173 175
174EOLIAN static Eina_Error 176EOLIAN static Eina_Error
diff --git a/src/lib/ecore_con/efl_net_server_simple.eo b/src/lib/ecore_con/efl_net_server_simple.eo
index 6558e6d632..6e3e5760c9 100644
--- a/src/lib/ecore_con/efl_net_server_simple.eo
+++ b/src/lib/ecore_con/efl_net_server_simple.eo
@@ -44,7 +44,7 @@ class Efl.Net.Server_Simple (Efl.Loop_Consumer, Efl.Net.Server) {
44 44
45 implements { 45 implements {
46 Efl.Object.finalize; 46 Efl.Object.finalize;
47 Efl.Object.destructor; 47 Efl.Object.invalidate;
48 Efl.Net.Server.serve; 48 Efl.Net.Server.serve;
49 Efl.Net.Server.client_announce; 49 Efl.Net.Server.client_announce;
50 Efl.Net.Server.address { get; } 50 Efl.Net.Server.address { get; }
diff --git a/src/lib/ecore_con/efl_net_server_ssl.c b/src/lib/ecore_con/efl_net_server_ssl.c
index 74292a1bd9..7315484b1c 100644
--- a/src/lib/ecore_con/efl_net_server_ssl.c
+++ b/src/lib/ecore_con/efl_net_server_ssl.c
@@ -149,14 +149,16 @@ _efl_net_server_ssl_ctx_del(void *data, const Efl_Event *event EINA_UNUSED)
149} 149}
150 150
151EOLIAN void 151EOLIAN void
152_efl_net_server_ssl_efl_object_destructor(Eo *o, Efl_Net_Server_Ssl_Data *pd) 152_efl_net_server_ssl_efl_object_invalidate(Eo *o, Efl_Net_Server_Ssl_Data *pd)
153{ 153{
154 if (pd->server) 154 pd->server = NULL;
155 {
156 efl_del(pd->server);
157 pd->server = NULL;
158 }
159 155
156 efl_destructor(efl_super(o, MY_CLASS));
157}
158
159EOLIAN void
160_efl_net_server_ssl_efl_object_destructor(Eo *o, Efl_Net_Server_Ssl_Data *pd)
161{
160 if (pd->ssl_ctx) 162 if (pd->ssl_ctx)
161 { 163 {
162 efl_event_callback_del(pd->ssl_ctx, EFL_EVENT_DEL, _efl_net_server_ssl_ctx_del, o); 164 efl_event_callback_del(pd->ssl_ctx, EFL_EVENT_DEL, _efl_net_server_ssl_ctx_del, o);
diff --git a/src/lib/ecore_con/efl_net_server_ssl.eo b/src/lib/ecore_con/efl_net_server_ssl.eo
index 1a0fd9cf5c..50ec24d80c 100644
--- a/src/lib/ecore_con/efl_net_server_ssl.eo
+++ b/src/lib/ecore_con/efl_net_server_ssl.eo
@@ -21,6 +21,7 @@ class Efl.Net.Server_Ssl (Efl.Net.Server_Tcp) {
21 21
22 implements { 22 implements {
23 Efl.Object.constructor; 23 Efl.Object.constructor;
24 Efl.Object.invalidate;
24 Efl.Object.destructor; 25 Efl.Object.destructor;
25 Efl.Net.Server.client_announce; 26 Efl.Net.Server.client_announce;
26 Efl.Net.Server_Fd.client_add; 27 Efl.Net.Server_Fd.client_add;
diff --git a/src/lib/ecore_con/efl_net_server_windows.c b/src/lib/ecore_con/efl_net_server_windows.c
index f227077036..fc01728d42 100644
--- a/src/lib/ecore_con/efl_net_server_windows.c
+++ b/src/lib/ecore_con/efl_net_server_windows.c
@@ -277,14 +277,16 @@ _efl_net_server_windows_efl_object_constructor(Eo *o, Efl_Net_Server_Windows_Dat
277} 277}
278 278
279EOLIAN static void 279EOLIAN static void
280_efl_net_server_windows_efl_object_destructor(Eo *o, Efl_Net_Server_Windows_Data *pd) 280_efl_net_server_windows_efl_object_invalidate(Eo *o, Efl_Net_Server_Windows_Data *pd)
281{ 281{
282 if (pd->next_client) 282 pd->next_client = NULL;
283 { 283
284 efl_del(pd->next_client); 284 efl_invalidate(efl_super(o, MY_CLASS));
285 pd->next_client = NULL; 285}
286 }
287 286
287EOLIAN static void
288_efl_net_server_windows_efl_object_destructor(Eo *o, Efl_Net_Server_Windows_Data *pd)
289{
288 while (pd->pending_clients) 290 while (pd->pending_clients)
289 { 291 {
290 Eo *client = pd->pending_clients->data; 292 Eo *client = pd->pending_clients->data;
diff --git a/src/lib/ecore_con/efl_net_server_windows.eo b/src/lib/ecore_con/efl_net_server_windows.eo
index e9c0b4933a..955d972430 100644
--- a/src/lib/ecore_con/efl_net_server_windows.eo
+++ b/src/lib/ecore_con/efl_net_server_windows.eo
@@ -25,6 +25,7 @@ class Efl.Net.Server_Windows (Efl.Loop_Consumer, Efl.Net.Server) {
25 25
26 implements { 26 implements {
27 Efl.Object.constructor; 27 Efl.Object.constructor;
28 Efl.Object.invalidate;
28 Efl.Object.destructor; 29 Efl.Object.destructor;
29 Efl.Net.Server.address { get; set; } 30 Efl.Net.Server.address { get; set; }
30 Efl.Net.Server.clients_count { get; set; } 31 Efl.Net.Server.clients_count { get; set; }