summaryrefslogtreecommitdiff
path: root/src/examples/ecore
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2018-03-29 00:42:10 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2018-03-29 13:30:55 +0900
commit2fb5cc3ad09f6aaf82b5d1131ac5ed22ed848bd4 (patch)
tree7a2c2c0371789ae4b139ebdf4a9ef60f82d324aa /src/examples/ecore
parentcc2b7a10a8236e2b3cc4a25b4b4fda95e00884fc (diff)
efl_add_ref - fis to use efl_add properly with a parent.
fixes bc18b7e7ad1f8c5d587400b27fabab0865017011 and 168849e8a08966ecc284e28f64126a3a85965965
Diffstat (limited to 'src/examples/ecore')
-rw-r--r--src/examples/ecore/ecore_audio_custom.c4
-rw-r--r--src/examples/ecore/ecore_audio_playback.c8
-rw-r--r--src/examples/ecore/ecore_audio_to_ogg.c18
-rw-r--r--src/examples/ecore/ecore_idler_example.c2
-rw-r--r--src/examples/ecore/ecore_poller_example.c12
-rw-r--r--src/examples/ecore/efl_io_copier_example.c12
-rw-r--r--src/examples/ecore/efl_io_queue_example.c8
-rw-r--r--src/examples/ecore/efl_net_server_example.c6
-rw-r--r--src/examples/ecore/efl_net_server_simple_example.c2
-rw-r--r--src/examples/ecore/efl_net_socket_ssl_dialer_example.c6
-rw-r--r--src/examples/ecore/efl_net_socket_ssl_server_example.c6
11 files changed, 42 insertions, 42 deletions
diff --git a/src/examples/ecore/ecore_audio_custom.c b/src/examples/ecore/ecore_audio_custom.c
index b0d26a1e75..abd174b78e 100644
--- a/src/examples/ecore/ecore_audio_custom.c
+++ b/src/examples/ecore/ecore_audio_custom.c
@@ -56,9 +56,9 @@ main(int argc, const char *argv[])
56 56
57 ecore_app_args_set(argc, argv); 57 ecore_app_args_set(argc, argv);
58 58
59 out = efl_add_ref(ECORE_AUDIO_OBJ_OUT_PULSE_CLASS, NULL); 59 out = efl_add(ECORE_AUDIO_OBJ_OUT_PULSE_CLASS, efl_main_loop_get());
60 60
61 in = efl_add_ref(ECORE_AUDIO_OBJ_IN_CLASS, NULL); 61 in = efl_add(ECORE_AUDIO_OBJ_IN_CLASS, efl_main_loop_get());
62 if (!in) 62 if (!in)
63 { 63 {
64 printf("error when creating ecore audio source.\n"); 64 printf("error when creating ecore audio source.\n");
diff --git a/src/examples/ecore/ecore_audio_playback.c b/src/examples/ecore/ecore_audio_playback.c
index c659f09d55..1c322738d3 100644
--- a/src/examples/ecore/ecore_audio_playback.c
+++ b/src/examples/ecore/ecore_audio_playback.c
@@ -201,7 +201,7 @@ static void _play_finished(void *data EINA_UNUSED, const Efl_Event *event)
201 201
202 inputs = eina_list_remove(inputs, event->object); 202 inputs = eina_list_remove(inputs, event->object);
203 ret = ecore_audio_obj_out_input_detach(out, event->object); 203 ret = ecore_audio_obj_out_input_detach(out, event->object);
204 efl_unref(event->object); 204 efl_del(event->object);
205 205
206 if (!ret) 206 if (!ret)
207 printf("Could not detach input %s\n", name); 207 printf("Could not detach input %s\n", name);
@@ -252,7 +252,7 @@ main(int argc, const char *argv[])
252 { 252 {
253 if (!strncmp(argv[i], "tone:", 5)) 253 if (!strncmp(argv[i], "tone:", 5))
254 { 254 {
255 in = efl_add_ref(ECORE_AUDIO_OBJ_IN_TONE_CLASS, NULL); 255 in = efl_add(ECORE_AUDIO_OBJ_IN_TONE_CLASS, efl_main_loop_get());
256 if (!in) 256 if (!in)
257 { 257 {
258 printf("error when creating ecore audio source.\n"); 258 printf("error when creating ecore audio source.\n");
@@ -276,7 +276,7 @@ main(int argc, const char *argv[])
276 } 276 }
277 else 277 else
278 { 278 {
279 in = efl_add_ref(ECORE_AUDIO_OBJ_IN_SNDFILE_CLASS, NULL); 279 in = efl_add(ECORE_AUDIO_OBJ_IN_SNDFILE_CLASS, efl_main_loop_get());
280 if (!in) 280 if (!in)
281 { 281 {
282 printf("error when creating ecore audio source.\n"); 282 printf("error when creating ecore audio source.\n");
@@ -307,7 +307,7 @@ main(int argc, const char *argv[])
307 307
308 printf("Start: %s (%0.2fs)\n", name, length); 308 printf("Start: %s (%0.2fs)\n", name, length);
309 309
310 out = efl_add_ref(ECORE_AUDIO_OBJ_OUT_PULSE_CLASS, NULL); 310 out = efl_add(ECORE_AUDIO_OBJ_OUT_PULSE_CLASS, efl_main_loop_get());
311 ret = ecore_audio_obj_out_input_attach(out, in); 311 ret = ecore_audio_obj_out_input_attach(out, in);
312 if (!ret) 312 if (!ret)
313 printf("Could not attach input %s\n", name); 313 printf("Could not attach input %s\n", name);
diff --git a/src/examples/ecore/ecore_audio_to_ogg.c b/src/examples/ecore/ecore_audio_to_ogg.c
index 756e69a209..63c7f66904 100644
--- a/src/examples/ecore/ecore_audio_to_ogg.c
+++ b/src/examples/ecore/ecore_audio_to_ogg.c
@@ -24,8 +24,8 @@ static void _play_finished(void *data EINA_UNUSED, const Efl_Event *event)
24 printf("Done: %s\n", name); 24 printf("Done: %s\n", name);
25 25
26 ecore_audio_obj_in_output_get(event->object, &out); 26 ecore_audio_obj_in_output_get(event->object, &out);
27 efl_unref(event->object); 27 efl_del(event->object);
28 efl_unref(out); 28 efl_del(out);
29 29
30 ecore_main_loop_quit(); 30 ecore_main_loop_quit();
31 31
@@ -49,31 +49,31 @@ main(int argc, char *argv[])
49 ecore_audio_init(); 49 ecore_audio_init();
50 50
51 51
52 in = efl_add_ref(ECORE_AUDIO_OBJ_IN_SNDFILE_CLASS, NULL); 52 in = efl_add(ECORE_AUDIO_OBJ_IN_SNDFILE_CLASS, efl_main_loop_get());
53 efl_name_set(in, basename(argv[1])); 53 efl_name_set(in, basename(argv[1]));
54 ret = ecore_audio_obj_source_set(in, argv[1]); 54 ret = ecore_audio_obj_source_set(in, argv[1]);
55 if (!ret) { 55 if (!ret) {
56 printf("Could not set %s as input\n", argv[1]); 56 printf("Could not set %s as input\n", argv[1]);
57 efl_unref(in); 57 efl_del(in);
58 return 1; 58 return 1;
59 } 59 }
60 60
61 efl_event_callback_add(in, ECORE_AUDIO_EV_IN_STOPPED, _play_finished, NULL); 61 efl_event_callback_add(in, ECORE_AUDIO_EV_IN_STOPPED, _play_finished, NULL);
62 62
63 out = efl_add_ref(ECORE_AUDIO_OBJ_OUT_SNDFILE_CLASS, NULL); 63 out = efl_add(ECORE_AUDIO_OBJ_OUT_SNDFILE_CLASS, efl_main_loop_get());
64 ret = ecore_audio_obj_source_set(out, argv[2]); 64 ret = ecore_audio_obj_source_set(out, argv[2]);
65 if (!ret) { 65 if (!ret) {
66 printf("Could not set %s as output\n", argv[2]); 66 printf("Could not set %s as output\n", argv[2]);
67 efl_unref(in); 67 efl_del(in);
68 efl_unref(out); 68 efl_del(out);
69 return 1; 69 return 1;
70 } 70 }
71 71
72 ret = ecore_audio_obj_out_input_attach(out, in); 72 ret = ecore_audio_obj_out_input_attach(out, in);
73 if (!ret) { 73 if (!ret) {
74 printf("Could not attach input\n"); 74 printf("Could not attach input\n");
75 efl_unref(out); 75 efl_del(out);
76 efl_unref(in); 76 efl_del(in);
77 return 1; 77 return 1;
78 } 78 }
79 79
diff --git a/src/examples/ecore/ecore_idler_example.c b/src/examples/ecore/ecore_idler_example.c
index 2185210763..a88a0029c8 100644
--- a/src/examples/ecore/ecore_idler_example.c
+++ b/src/examples/ecore/ecore_idler_example.c
@@ -110,7 +110,7 @@ main(void)
110 ctxt.enterer = ecore_idle_enterer_add(_enterer_cb, &ctxt); 110 ctxt.enterer = ecore_idle_enterer_add(_enterer_cb, &ctxt);
111 ctxt.exiter = ecore_idle_exiter_add(_exiter_cb, &ctxt); 111 ctxt.exiter = ecore_idle_exiter_add(_exiter_cb, &ctxt);
112 ctxt.idler = ecore_idler_add(_idler_cb, &ctxt); 112 ctxt.idler = ecore_idler_add(_idler_cb, &ctxt);
113// ctxt.idler = efl_add_ref(ECORE_IDLER_CLASS, NULL, ecore_idler_constructor(efl_added, _idler_cb, &ctxt)); 113// ctxt.idler = efl_add(ECORE_IDLER_CLASS, efl_main_loop_get(), ecore_idler_constructor(efl_added, _idler_cb, &ctxt));
114 ctxt.handler = ecore_event_handler_add(_event_type, 114 ctxt.handler = ecore_event_handler_add(_event_type,
115 _event_handler_cb, 115 _event_handler_cb,
116 &ctxt); 116 &ctxt);
diff --git a/src/examples/ecore/ecore_poller_example.c b/src/examples/ecore/ecore_poller_example.c
index 3cbbcc5f2e..928b937599 100644
--- a/src/examples/ecore/ecore_poller_example.c
+++ b/src/examples/ecore/ecore_poller_example.c
@@ -48,9 +48,9 @@ main(void)
48 poller2 = ecore_poller_add(ECORE_POLLER_CORE, 8, _poller_print_cb, str2); 48 poller2 = ecore_poller_add(ECORE_POLLER_CORE, 8, _poller_print_cb, str2);
49 poller3 = ecore_poller_add(ECORE_POLLER_CORE, 30, _poller_quit_cb, str3); 49 poller3 = ecore_poller_add(ECORE_POLLER_CORE, 30, _poller_quit_cb, str3);
50 50
51// poller1 = efl_add_ref(ECORE_POLLER_CLASS, NULL, // ecore_poller_constructor(efl_added, ECORE_POLLER_CORE, 4, _poller_print_cb, str1)); 51// poller1 = efl_add(ECORE_POLLER_CLASS, efl_main_loop_get(), // ecore_poller_constructor(efl_added, ECORE_POLLER_CORE, 4, _poller_print_cb, str1));
52// poller2 = efl_add_ref(ECORE_POLLER_CLASS, NULL, // ecore_poller_constructor(efl_added, ECORE_POLLER_CORE, 8, _poller_print_cb, str2)); 52// poller2 = efl_add(ECORE_POLLER_CLASS, efl_main_loop_get(), // ecore_poller_constructor(efl_added, ECORE_POLLER_CORE, 8, _poller_print_cb, str2));
53// poller3 = efl_add_ref(ECORE_POLLER_CLASS, NULL, // ecore_poller_constructor(efl_added, ECORE_POLLER_CORE, 20, _poller_quit_cb, str3)); 53// poller3 = efl_add(ECORE_POLLER_CLASS, efl_main_loop_get(), // ecore_poller_constructor(efl_added, ECORE_POLLER_CORE, 20, _poller_quit_cb, str3));
54 54
55 55
56 ecore_main_loop_begin(); 56 ecore_main_loop_begin();
@@ -61,9 +61,9 @@ main(void)
61// ecore_poller_interval_set(poller2, 16, NULL); 61// ecore_poller_interval_set(poller2, 16, NULL);
62 ecore_main_loop_begin(); 62 ecore_main_loop_begin();
63 63
64// efl_unref(poller1); 64// efl_del(poller1);
65// efl_unref(poller2); 65// efl_del(poller2);
66// efl_unref(poller3); 66// efl_del(poller3);
67 ecore_poller_del(poller1); 67 ecore_poller_del(poller1);
68 ecore_poller_del(poller2); 68 ecore_poller_del(poller2);
69 ecore_poller_del(poller3); 69 ecore_poller_del(poller3);
diff --git a/src/examples/ecore/efl_io_copier_example.c b/src/examples/ecore/efl_io_copier_example.c
index b7e526bd3c..a07b79186a 100644
--- a/src/examples/ecore/efl_io_copier_example.c
+++ b/src/examples/ecore/efl_io_copier_example.c
@@ -452,7 +452,7 @@ efl_main(void *data EINA_UNUSED,
452 452
453 if (strcmp(input_fname, ":stdin:") == 0) 453 if (strcmp(input_fname, ":stdin:") == 0)
454 { 454 {
455 input = efl_add_ref(EFL_IO_STDIN_CLASS, NULL, 455 input = efl_add(EFL_IO_STDIN_CLASS, ev->object,
456 efl_event_callback_array_add(efl_added, input_cbs(), NULL)); 456 efl_event_callback_array_add(efl_added, input_cbs(), NULL));
457 if (!input) 457 if (!input)
458 { 458 {
@@ -662,7 +662,7 @@ efl_main(void *data EINA_UNUSED,
662 else 662 else
663 { 663 {
664 /* regular file, open with flags: read-only and close-on-exec */ 664 /* regular file, open with flags: read-only and close-on-exec */
665 input = efl_add_ref(EFL_IO_FILE_CLASS, NULL, 665 input = efl_add(EFL_IO_FILE_CLASS, ev->object,
666 efl_file_set(efl_added, input_fname, NULL), /* mandatory */ 666 efl_file_set(efl_added, input_fname, NULL), /* mandatory */
667 efl_io_file_flags_set(efl_added, O_RDONLY), /* default */ 667 efl_io_file_flags_set(efl_added, O_RDONLY), /* default */
668 efl_io_closer_close_on_exec_set(efl_added, EINA_TRUE), /* recommended, set *after* flags, or include O_CLOEXEC in flags -- be careful with _WIN32 that doesn't support it. */ 668 efl_io_closer_close_on_exec_set(efl_added, EINA_TRUE), /* recommended, set *after* flags, or include O_CLOEXEC in flags -- be careful with _WIN32 that doesn't support it. */
@@ -679,7 +679,7 @@ efl_main(void *data EINA_UNUSED,
679 679
680 if (strcmp(output_fname, ":stdout:") == 0) 680 if (strcmp(output_fname, ":stdout:") == 0)
681 { 681 {
682 output = efl_add_ref(EFL_IO_STDOUT_CLASS, NULL, 682 output = efl_add(EFL_IO_STDOUT_CLASS, ev->object,
683 efl_event_callback_array_add(efl_added, output_cbs(), NULL) /* optional */ 683 efl_event_callback_array_add(efl_added, output_cbs(), NULL) /* optional */
684 ); 684 );
685 if (!output) 685 if (!output)
@@ -691,7 +691,7 @@ efl_main(void *data EINA_UNUSED,
691 } 691 }
692 else if (strcmp(output_fname, ":stderr:") == 0) 692 else if (strcmp(output_fname, ":stderr:") == 0)
693 { 693 {
694 output = efl_add_ref(EFL_IO_STDERR_CLASS, NULL, 694 output = efl_add(EFL_IO_STDERR_CLASS, ev->object,
695 efl_event_callback_array_add(efl_added, output_cbs(), NULL) /* optional */ 695 efl_event_callback_array_add(efl_added, output_cbs(), NULL) /* optional */
696 ); 696 );
697 if (!output) 697 if (!output)
@@ -718,7 +718,7 @@ efl_main(void *data EINA_UNUSED,
718 * When finished get the efl_io_buffer_slice_get(), see 718 * When finished get the efl_io_buffer_slice_get(), see
719 * _copier_done(). 719 * _copier_done().
720 */ 720 */
721 output = efl_add_ref(EFL_IO_BUFFER_CLASS, NULL, 721 output = efl_add(EFL_IO_BUFFER_CLASS, ev->object,
722 efl_event_callback_array_add(efl_added, output_cbs(), NULL), /* optional */ 722 efl_event_callback_array_add(efl_added, output_cbs(), NULL), /* optional */
723 efl_event_callback_array_add(efl_added, output_buffer_cbs(), NULL) /* optional */ 723 efl_event_callback_array_add(efl_added, output_buffer_cbs(), NULL) /* optional */
724 ); 724 );
@@ -938,7 +938,7 @@ efl_main(void *data EINA_UNUSED,
938 /* regular file, open with flags: write-only, close-on-exec, 938 /* regular file, open with flags: write-only, close-on-exec,
939 * create if did not exist and truncate if exist. 939 * create if did not exist and truncate if exist.
940 */ 940 */
941 output = efl_add_ref(EFL_IO_FILE_CLASS, NULL, 941 output = efl_add(EFL_IO_FILE_CLASS, ev->object,
942 efl_file_set(efl_added, output_fname, NULL), /* mandatory */ 942 efl_file_set(efl_added, output_fname, NULL), /* mandatory */
943 efl_io_file_flags_set(efl_added, O_WRONLY | O_CREAT | O_TRUNC), /* mandatory for write */ 943 efl_io_file_flags_set(efl_added, O_WRONLY | O_CREAT | O_TRUNC), /* mandatory for write */
944 efl_io_closer_close_on_exec_set(efl_added, EINA_TRUE), /* recommended, set *after* flags, or include O_CLOEXEC in flags -- be careful with _WIN32 that doesn't support it. */ 944 efl_io_closer_close_on_exec_set(efl_added, EINA_TRUE), /* recommended, set *after* flags, or include O_CLOEXEC in flags -- be careful with _WIN32 that doesn't support it. */
diff --git a/src/examples/ecore/efl_io_queue_example.c b/src/examples/ecore/efl_io_queue_example.c
index 9367716729..1abd3b71b6 100644
--- a/src/examples/ecore/efl_io_queue_example.c
+++ b/src/examples/ecore/efl_io_queue_example.c
@@ -258,7 +258,7 @@ efl_main(void *data EINA_UNUSED,
258 * the line_delimiter, then wait for a reply from the server, then 258 * the line_delimiter, then wait for a reply from the server, then
259 * write another. 259 * write another.
260 */ 260 */
261 send_queue = efl_add_ref(EFL_IO_QUEUE_CLASS, NULL, 261 send_queue = efl_add(EFL_IO_QUEUE_CLASS, ev->object,
262 efl_name_set(efl_added, "send_queue"), 262 efl_name_set(efl_added, "send_queue"),
263 efl_io_queue_limit_set(efl_added, buffer_limit)); 263 efl_io_queue_limit_set(efl_added, buffer_limit));
264 if (!send_queue) 264 if (!send_queue)
@@ -279,7 +279,7 @@ efl_main(void *data EINA_UNUSED,
279 * Our example's usage is to peek its data with slice_get() then 279 * Our example's usage is to peek its data with slice_get() then
280 * clear(). 280 * clear().
281 */ 281 */
282 receive_queue = efl_add_ref(EFL_IO_QUEUE_CLASS, NULL, 282 receive_queue = efl_add(EFL_IO_QUEUE_CLASS, ev->object,
283 efl_name_set(efl_added, "receive_queue"), 283 efl_name_set(efl_added, "receive_queue"),
284 efl_io_queue_limit_set(efl_added, buffer_limit), 284 efl_io_queue_limit_set(efl_added, buffer_limit),
285 efl_event_callback_add(efl_added, EFL_IO_QUEUE_EVENT_SLICE_CHANGED, _receiver_data, NULL)); 285 efl_event_callback_add(efl_added, EFL_IO_QUEUE_EVENT_SLICE_CHANGED, _receiver_data, NULL));
@@ -359,9 +359,9 @@ efl_main(void *data EINA_UNUSED,
359 error_sender: 359 error_sender:
360 efl_del(dialer); 360 efl_del(dialer);
361 error_dialer: 361 error_dialer:
362 efl_unref(receive_queue); 362 efl_del(receive_queue);
363 error_receive_queue: 363 error_receive_queue:
364 efl_unref(send_queue); 364 efl_del(send_queue);
365 end: 365 end:
366 EINA_LIST_FREE(commands, cmd) 366 EINA_LIST_FREE(commands, cmd)
367 { 367 {
diff --git a/src/examples/ecore/efl_net_server_example.c b/src/examples/ecore/efl_net_server_example.c
index 6d5aa30e80..694ce76418 100644
--- a/src/examples/ecore/efl_net_server_example.c
+++ b/src/examples/ecore/efl_net_server_example.c
@@ -350,11 +350,11 @@ _server_client_add(void *data EINA_UNUSED, const Efl_Event *event)
350 return; 350 return;
351 } 351 }
352 352
353 send_buffer = efl_add_ref(EFL_IO_BUFFER_CLASS, NULL, 353 send_buffer = efl_add(EFL_IO_BUFFER_CLASS, efl_main_loop_get(),
354 efl_io_buffer_adopt_readonly(efl_added, hello_world_slice)); 354 efl_io_buffer_adopt_readonly(efl_added, hello_world_slice));
355 355
356 /* Unlimited buffer to store the received data. */ 356 /* Unlimited buffer to store the received data. */
357 recv_buffer = efl_add_ref(EFL_IO_BUFFER_CLASS, NULL); 357 recv_buffer = efl_add(EFL_IO_BUFFER_CLASS, efl_main_loop_get());
358 358
359 /* an input copier that takes data from send_buffer and pushes to client */ 359 /* an input copier that takes data from send_buffer and pushes to client */
360 d->send_copier = efl_add(EFL_IO_COPIER_CLASS, efl_parent_get(client), 360 d->send_copier = efl_add(EFL_IO_COPIER_CLASS, efl_parent_get(client),
@@ -712,7 +712,7 @@ efl_main(void *data EINA_UNUSED,
712 cipher = EFL_NET_SSL_CIPHER_TLSV1_2; 712 cipher = EFL_NET_SSL_CIPHER_TLSV1_2;
713 } 713 }
714 714
715 ssl_ctx = efl_add_ref(EFL_NET_SSL_CONTEXT_CLASS, NULL, 715 ssl_ctx = efl_add(EFL_NET_SSL_CONTEXT_CLASS, efl_main_loop_get(),
716 efl_net_ssl_context_certificates_set(efl_added, eina_list_iterator_new(certificates)), 716 efl_net_ssl_context_certificates_set(efl_added, eina_list_iterator_new(certificates)),
717 efl_net_ssl_context_private_keys_set(efl_added, eina_list_iterator_new(private_keys)), 717 efl_net_ssl_context_private_keys_set(efl_added, eina_list_iterator_new(private_keys)),
718 efl_net_ssl_context_certificate_revocation_lists_set(efl_added, eina_list_iterator_new(crls)), 718 efl_net_ssl_context_certificate_revocation_lists_set(efl_added, eina_list_iterator_new(crls)),
diff --git a/src/examples/ecore/efl_net_server_simple_example.c b/src/examples/ecore/efl_net_server_simple_example.c
index 2d21352d03..485dc81476 100644
--- a/src/examples/ecore/efl_net_server_simple_example.c
+++ b/src/examples/ecore/efl_net_server_simple_example.c
@@ -520,7 +520,7 @@ efl_main(void *data EINA_UNUSED,
520 cipher = EFL_NET_SSL_CIPHER_TLSV1_2; 520 cipher = EFL_NET_SSL_CIPHER_TLSV1_2;
521 } 521 }
522 522
523 ssl_ctx = efl_add_ref(EFL_NET_SSL_CONTEXT_CLASS, NULL, 523 ssl_ctx = efl_add(EFL_NET_SSL_CONTEXT_CLASS, ev->object,
524 efl_net_ssl_context_certificates_set(efl_added, eina_list_iterator_new(certificates)), 524 efl_net_ssl_context_certificates_set(efl_added, eina_list_iterator_new(certificates)),
525 efl_net_ssl_context_private_keys_set(efl_added, eina_list_iterator_new(private_keys)), 525 efl_net_ssl_context_private_keys_set(efl_added, eina_list_iterator_new(private_keys)),
526 efl_net_ssl_context_certificate_revocation_lists_set(efl_added, eina_list_iterator_new(crls)), 526 efl_net_ssl_context_certificate_revocation_lists_set(efl_added, eina_list_iterator_new(crls)),
diff --git a/src/examples/ecore/efl_net_socket_ssl_dialer_example.c b/src/examples/ecore/efl_net_socket_ssl_dialer_example.c
index 75acb0b42d..e3579b471a 100644
--- a/src/examples/ecore/efl_net_socket_ssl_dialer_example.c
+++ b/src/examples/ecore/efl_net_socket_ssl_dialer_example.c
@@ -311,7 +311,7 @@ efl_terminate(void *data EINA_UNUSED,
311 efl_del(dialer); 311 efl_del(dialer);
312 dialer = NULL; 312 dialer = NULL;
313 313
314 efl_unref(ssl_ctx); 314 efl_del(ssl_ctx);
315 ssl_ctx = NULL; 315 ssl_ctx = NULL;
316 316
317 EINA_LIST_FREE(pending_send, str) free(str); 317 EINA_LIST_FREE(pending_send, str) free(str);
@@ -456,7 +456,7 @@ efl_main(void *data EINA_UNUSED,
456 /* create a new SSL context with command line configurations. 456 /* create a new SSL context with command line configurations.
457 * another option would be to use the default dialer context */ 457 * another option would be to use the default dialer context */
458#ifndef USE_DEFAULT_CONTEXT 458#ifndef USE_DEFAULT_CONTEXT
459 ssl_ctx = efl_add_ref(EFL_NET_SSL_CONTEXT_CLASS, NULL, 459 ssl_ctx = efl_add(EFL_NET_SSL_CONTEXT_CLASS, ev->object,
460 efl_net_ssl_context_certificates_set(efl_added, eina_list_iterator_new(certificates)), 460 efl_net_ssl_context_certificates_set(efl_added, eina_list_iterator_new(certificates)),
461 efl_net_ssl_context_private_keys_set(efl_added, eina_list_iterator_new(private_keys)), 461 efl_net_ssl_context_private_keys_set(efl_added, eina_list_iterator_new(private_keys)),
462 efl_net_ssl_context_certificate_revocation_lists_set(efl_added, eina_list_iterator_new(crls)), 462 efl_net_ssl_context_certificate_revocation_lists_set(efl_added, eina_list_iterator_new(crls)),
@@ -528,7 +528,7 @@ efl_main(void *data EINA_UNUSED,
528 efl_io_closer_close(dialer); /* just del won't do as ssl has an extra ref */ 528 efl_io_closer_close(dialer); /* just del won't do as ssl has an extra ref */
529 efl_del(dialer); 529 efl_del(dialer);
530 no_ssl_ctx: 530 no_ssl_ctx:
531 efl_unref(ssl_ctx); 531 efl_del(ssl_ctx);
532 532
533 end: 533 end:
534 EINA_LIST_FREE(pending_send, str) free(str); 534 EINA_LIST_FREE(pending_send, str) free(str);
diff --git a/src/examples/ecore/efl_net_socket_ssl_server_example.c b/src/examples/ecore/efl_net_socket_ssl_server_example.c
index 1010ca7fda..77d435e107 100644
--- a/src/examples/ecore/efl_net_socket_ssl_server_example.c
+++ b/src/examples/ecore/efl_net_socket_ssl_server_example.c
@@ -227,7 +227,7 @@ efl_terminate(void *data EINA_UNUSED,
227 efl_del(server); 227 efl_del(server);
228 server = NULL; 228 server = NULL;
229 229
230 efl_unref(ssl_ctx); 230 efl_del(ssl_ctx);
231 ssl_ctx = NULL; 231 ssl_ctx = NULL;
232 232
233 EINA_LIST_FREE(certificates, str) free(str); 233 EINA_LIST_FREE(certificates, str) free(str);
@@ -301,7 +301,7 @@ efl_main(void *data EINA_UNUSED,
301 cipher = EFL_NET_SSL_CIPHER_TLSV1_2; 301 cipher = EFL_NET_SSL_CIPHER_TLSV1_2;
302 } 302 }
303 303
304 ssl_ctx = efl_add_ref(EFL_NET_SSL_CONTEXT_CLASS, NULL, 304 ssl_ctx = efl_add(EFL_NET_SSL_CONTEXT_CLASS, ev->object,
305 efl_net_ssl_context_certificates_set(efl_added, eina_list_iterator_new(certificates)), 305 efl_net_ssl_context_certificates_set(efl_added, eina_list_iterator_new(certificates)),
306 efl_net_ssl_context_private_keys_set(efl_added, eina_list_iterator_new(private_keys)), 306 efl_net_ssl_context_private_keys_set(efl_added, eina_list_iterator_new(private_keys)),
307 efl_net_ssl_context_certificate_revocation_lists_set(efl_added, eina_list_iterator_new(crls)), 307 efl_net_ssl_context_certificate_revocation_lists_set(efl_added, eina_list_iterator_new(crls)),
@@ -363,7 +363,7 @@ efl_main(void *data EINA_UNUSED,
363 efl_del(server); 363 efl_del(server);
364 server = NULL; 364 server = NULL;
365 end_ctx: 365 end_ctx:
366 efl_unref(ssl_ctx); 366 efl_del(ssl_ctx);
367 367
368 end: 368 end:
369 EINA_LIST_FREE(certificates, str) free(str); 369 EINA_LIST_FREE(certificates, str) free(str);