From bc256df33a57e585367edffe33d3e58d53f82ce8 Mon Sep 17 00:00:00 2001 From: Alexander Gluzsky Date: Mon, 4 Mar 2013 00:36:29 +0000 Subject: fixed retrieving exit code from gpg process git-svn-id: http://svn.miranda-ng.org/main/trunk@3879 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/New_GPG/src/gpg_wrapper.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'plugins/New_GPG/src/gpg_wrapper.cpp') diff --git a/plugins/New_GPG/src/gpg_wrapper.cpp b/plugins/New_GPG/src/gpg_wrapper.cpp index 598537a2ca..112d86080f 100755 --- a/plugins/New_GPG/src/gpg_wrapper.cpp +++ b/plugins/New_GPG/src/gpg_wrapper.cpp @@ -71,6 +71,7 @@ pxResult pxExecute(std::vector &aargv, string *aoutput, LPDWORD ae pipe pout = create_pipe(); pipe perr = create_pipe(); + child *c = nullptr; { file_descriptor_sink sout(pout.sink, close_handle); file_descriptor_sink serr(perr.sink, close_handle); @@ -78,8 +79,8 @@ pxResult pxExecute(std::vector &aargv, string *aoutput, LPDWORD ae char *mir_path = new char [MAX_PATH]; PathToAbsolute("\\", mir_path); - child c = execute(set_args(argv), bind_stdout(sout), bind_stderr(serr), close_stdin(),/*bind_stdin(sin),*/ show_window(SW_HIDE), hide_console(), inherit_env(), set_env(env), start_in_dir(toUTF16(mir_path))); - _child = &c; + c = new child(execute(set_args(argv), bind_stdout(sout), bind_stderr(serr), close_stdin(),/*bind_stdin(sin),*/ show_window(SW_HIDE), hide_console(), inherit_env(), set_env(env), start_in_dir(toUTF16(mir_path)))); + _child = c; delete [] mir_path; } @@ -126,8 +127,9 @@ pxResult pxExecute(std::vector &aargv, string *aoutput, LPDWORD ae if(bDebugLog) debuglog<