summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorVincent Torri <vincent dot torri at gmail dot com>2015-09-27 11:24:42 +0200
committerCedric BAIL <cedric@osg.samsung.com>2015-10-12 17:21:59 -0700
commitee8df155d97830b149f4f972a253a67bfeab00bd (patch)
treea85a78e056e65eceaf2168272603bc9ed034c687 /src/lib
parent8c8bfda9788ef24cbdc237bcfbd6cbb075d6e4d6 (diff)
ecore_exe: use macro to free resources
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/ecore/ecore_exe_win32.c38
1 files changed, 10 insertions, 28 deletions
diff --git a/src/lib/ecore/ecore_exe_win32.c b/src/lib/ecore/ecore_exe_win32.c
index 627adeb668..21ddb71681 100644
--- a/src/lib/ecore/ecore_exe_win32.c
+++ b/src/lib/ecore/ecore_exe_win32.c
@@ -57,16 +57,8 @@ _ecore_exe_threads_terminate(Ecore_Exe *obj)
57 { 57 {
58 exe->close_threads = 1; 58 exe->close_threads = 1;
59 WaitForMultipleObjects(i, threads, TRUE, INFINITE); 59 WaitForMultipleObjects(i, threads, TRUE, INFINITE);
60 if (exe->pipe_error.thread) 60 IF_FN_DEL(CloseHandle, exe->pipe_error.thread);
61 { 61 IF_FN_DEL(CloseHandle, exe->pipe_read.thread);
62 CloseHandle(exe->pipe_error.thread);
63 exe->pipe_error.thread = NULL;
64 }
65 if (exe->pipe_read.thread)
66 {
67 CloseHandle(exe->pipe_read.thread);
68 exe->pipe_read.thread = NULL;
69 }
70 } 62 }
71} 63}
72 64
@@ -707,26 +699,16 @@ _impl_ecore_exe_eo_base_destructor(Eo *obj, Ecore_Exe_Data *exe)
707 if (exe->pre_free_cb) 699 if (exe->pre_free_cb)
708 exe->pre_free_cb(data, obj); 700 exe->pre_free_cb(data, obj);
709 701
710 if (exe->h_close) 702 IF_FN_DEL(ecore_main_win32_handler_del, exe->h_close);
711 ecore_main_win32_handler_del(exe->h_close);
712
713 CloseHandle(exe->process_thread);
714 CloseHandle(exe->process);
715
716 if (exe->pipe_write.child_pipe)
717 CloseHandle(exe->pipe_write.child_pipe);
718 if (exe->pipe_write.child_pipe_x)
719 CloseHandle(exe->pipe_write.child_pipe_x);
720
721 _ecore_exe_threads_terminate(obj);
722 if (exe->pipe_error.child_pipe)
723 CloseHandle(exe->pipe_error.child_pipe);
724 703
725 if (exe->pipe_read.child_pipe) 704 IF_FN_DEL(CloseHandle, exe->process_thread);
726 CloseHandle(exe->pipe_read.child_pipe); 705 IF_FN_DEL(CloseHandle, exe->process);
706 IF_FN_DEL(CloseHandle, exe->pipe_write.child_pipe);
707 IF_FN_DEL(CloseHandle, exe->pipe_write.child_pipe_x);
708 IF_FN_DEL(CloseHandle, exe->pipe_error.child_pipe);
709 IF_FN_DEL(CloseHandle, exe->pipe_read.child_pipe);
727 710
728 if (exe->cmd) 711 IF_FREE(exe->cmd);
729 free(exe->cmd);
730 712
731 _ecore_exe_exes = eina_list_remove(_ecore_exe_exes, obj); 713 _ecore_exe_exes = eina_list_remove(_ecore_exe_exes, obj);
732 IF_FREE(exe->tag); 714 IF_FREE(exe->tag);