From 4a148e8704abae184ab3165ec2f6e925e956c656 Mon Sep 17 00:00:00 2001 From: Armin Novak Date: Tue, 20 Oct 2020 09:08:37 +0200 Subject: [PATCH] Fixed mac app termination and warnings (cherry picked from commit a2e9f5efcb54a409ca67b2794ab20c391d732fe6) --- client/Mac/MRDPView.m | 3 +-- client/Mac/cli/AppDelegate.m | 5 +++++ client/Mac/cli/main.m | 2 +- client/Mac/main.m | 4 ++-- client/Mac/mf_client.m | 2 +- 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/client/Mac/MRDPView.m b/client/Mac/MRDPView.m index dc07cdc..70f67e1 100644 --- a/client/Mac/MRDPView.m +++ b/client/Mac/MRDPView.m @@ -864,8 +864,7 @@ BOOL mac_pre_connect(freerdp *instance) if (!settings->ServerHostname) { WLog_ERR(TAG, "error: server hostname was not specified with /v:[:port]"); - [NSApp terminate:nil]; - return -1; + return FALSE; } settings->OsMajorType = OSMAJORTYPE_MACINTOSH; diff --git a/client/Mac/cli/AppDelegate.m b/client/Mac/cli/AppDelegate.m index d916e71..6986956 100644 --- a/client/Mac/cli/AppDelegate.m +++ b/client/Mac/cli/AppDelegate.m @@ -73,6 +73,10 @@ void mac_set_view_size(rdpContext *context, MRDPView *view); [window setTitle:winTitle]; } + else + { + [NSApp terminate:self]; + } } - (void)applicationWillBecomeActive:(NSNotification *)notification @@ -92,6 +96,7 @@ void mac_set_view_size(rdpContext *context, MRDPView *view); [mrdpView releaseResources]; _singleDelegate = nil; NSLog(@"Stopped.\n"); + [NSApp terminate:self]; } - (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)sender diff --git a/client/Mac/cli/main.m b/client/Mac/cli/main.m index 69643ef..7e5e478 100644 --- a/client/Mac/cli/main.m +++ b/client/Mac/cli/main.m @@ -8,7 +8,7 @@ #import -int main(int argc, char *argv[]) +int main(int argc, const char *argv[]) { return NSApplicationMain(argc, argv); } diff --git a/client/Mac/main.m b/client/Mac/main.m index 4cba6cf..0f1916e 100644 --- a/client/Mac/main.m +++ b/client/Mac/main.m @@ -19,7 +19,7 @@ #import -int main(int argc, char *argv[]) +int main(int argc, const char *argv[]) { - return NSApplicationMain(argc, (const char **)argv); + return NSApplicationMain(argc, argv); } diff --git a/client/Mac/mf_client.m b/client/Mac/mf_client.m index 10fb1b4..a46d3d1 100644 --- a/client/Mac/mf_client.m +++ b/client/Mac/mf_client.m @@ -62,6 +62,7 @@ static int mfreerdp_client_stop(rdpContext *context) { mfContext *mfc = (mfContext *)context; + freerdp_abort_connect(context->instance); if (mfc->thread) { SetEvent(mfc->stopEvent); @@ -97,7 +98,6 @@ static BOOL mfreerdp_client_new(freerdp *instance, rdpContext *context) context->instance->LogonErrorInfo = mac_logon_error_info; context->instance->settings = instance->settings; settings = context->settings; - settings->AsyncUpdate = TRUE; settings->AsyncInput = TRUE; return TRUE; } -- 2.7.4