summaryrefslogtreecommitdiff
path: root/src/lib/ecore_con
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2018-05-01 16:23:05 -0700
committerCedric BAIL <cedric@osg.samsung.com>2018-05-24 16:02:18 -0700
commit69c9d5bb50b4ff358b2055cbed544fda3e8dc016 (patch)
tree8112c2700d9b92661059433f9b28ce2155cde9c4 /src/lib/ecore_con
parent594c254183cc3459aabe251b94cc2591b2b569cd (diff)
ecore_con: correct lifecycle of object used by Efl.Net.Dialer.Ssl.
Differential Revision: https://phab.enlightenment.org/D6084
Diffstat (limited to 'src/lib/ecore_con')
-rw-r--r--src/lib/ecore_con/efl_net_dialer_ssl.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/lib/ecore_con/efl_net_dialer_ssl.c b/src/lib/ecore_con/efl_net_dialer_ssl.c
index 9a89ea90d2..58189eea6f 100644
--- a/src/lib/ecore_con/efl_net_dialer_ssl.c
+++ b/src/lib/ecore_con/efl_net_dialer_ssl.c
@@ -63,7 +63,7 @@ _efl_net_dialer_ssl_efl_object_constructor(Eo *o, Efl_Net_Dialer_Ssl_Data *pd)
63 o = efl_constructor(efl_super(o, MY_CLASS)); 63 o = efl_constructor(efl_super(o, MY_CLASS));
64 if (!o) return NULL; 64 if (!o) return NULL;
65 65
66 pd->sock = efl_add(EFL_NET_DIALER_TCP_CLASS, o); 66 pd->sock = efl_add_ref(EFL_NET_DIALER_TCP_CLASS, o);
67 EINA_SAFETY_ON_NULL_RETURN_VAL(pd->sock, NULL); 67 EINA_SAFETY_ON_NULL_RETURN_VAL(pd->sock, NULL);
68 68
69 efl_event_callback_array_add(o, _efl_net_dialer_ssl_cbs(), o); 69 efl_event_callback_array_add(o, _efl_net_dialer_ssl_cbs(), o);
@@ -78,9 +78,8 @@ _efl_net_dialer_ssl_efl_object_finalize(Eo *o, Efl_Net_Dialer_Ssl_Data *pd)
78 78
79 if (efl_net_socket_ssl_adopted_get(o, &a_sock, &a_ctx)) 79 if (efl_net_socket_ssl_adopted_get(o, &a_sock, &a_ctx))
80 { 80 {
81 efl_del(pd->sock); /* stub TCP we created */ 81 efl_replace(&pd->sock, a_sock); /* stub TCP we created */
82 pd->sock = a_sock; 82 efl_replace(&pd->ssl_ctx, a_ctx);
83 pd->ssl_ctx = a_ctx;
84 } 83 }
85 else 84 else
86 { 85 {
@@ -106,11 +105,8 @@ _efl_net_dialer_ssl_efl_object_invalidate(Eo *o, Efl_Net_Dialer_Ssl_Data *pd)
106 efl_event_thaw(o); 105 efl_event_thaw(o);
107 } 106 }
108 107
109 if (pd->ssl_ctx) 108 efl_replace(&pd->ssl_ctx, NULL);
110 { 109 efl_replace(&pd->sock, NULL);
111 efl_unref(pd->ssl_ctx);
112 pd->ssl_ctx = NULL;
113 }
114 110
115 efl_invalidate(efl_super(o, MY_CLASS)); 111 efl_invalidate(efl_super(o, MY_CLASS));
116} 112}
@@ -122,8 +118,7 @@ _efl_net_dialer_ssl_ssl_context_set(Eo *o, Efl_Net_Dialer_Ssl_Data *pd, Eo *ssl_
122 EINA_SAFETY_ON_FALSE_RETURN(efl_isa(ssl_ctx, EFL_NET_SSL_CONTEXT_CLASS)); 118 EINA_SAFETY_ON_FALSE_RETURN(efl_isa(ssl_ctx, EFL_NET_SSL_CONTEXT_CLASS));
123 119
124 if (pd->ssl_ctx == ssl_ctx) return; 120 if (pd->ssl_ctx == ssl_ctx) return;
125 efl_unref(pd->ssl_ctx); 121 efl_replace(&pd->ssl_ctx, ssl_ctx);
126 pd->ssl_ctx = efl_ref(ssl_ctx);
127} 122}
128 123
129EOLIAN static Eo * 124EOLIAN static Eo *