From 4aae7aaa163cb6e69dc7e31fd9cf1c302f5a4ab5 Mon Sep 17 00:00:00 2001 From: heckflosse Date: Sun, 19 Mar 2017 18:39:45 +0100 Subject: [PATCH] Rawtherapee hanging on Windows if verbose = true, fixes #3768 --- rtgui/main.cc | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/rtgui/main.cc b/rtgui/main.cc index 00cdc3b94..155d9f3ba 100644 --- a/rtgui/main.cc +++ b/rtgui/main.cc @@ -204,8 +204,7 @@ int main(int argc, char **argv) break; } - if(Console) { - AllocConsole(); + if(Console && AllocConsole()) { AttachConsole( GetCurrentProcessId() ) ; // Don't allow CTRL-C in console to terminate RT SetConsoleCtrlHandler( NULL, true ); @@ -243,16 +242,18 @@ int main(int argc, char **argv) } } - int ret = processLineParams( argc, argv); + if(argc > 1) { + int ret = processLineParams( argc, argv); - if( ret <= 0 ) { - if(consoleOpened) { - printf("Press any key to exit RawTherapee\n"); - FlushConsoleInputBuffer(GetStdHandle(STD_INPUT_HANDLE)); - getch(); + if( ret <= 0 ) { + if(consoleOpened) { + printf("Press any key to exit RawTherapee\n"); + FlushConsoleInputBuffer(GetStdHandle(STD_INPUT_HANDLE)); + getch(); + } + + return ret; } - - return ret; } }