Fixed mac app termination and warnings

This commit is contained in:
Armin Novak 2020-10-20 09:08:37 +02:00 committed by akallabeth
parent 0e0eb5f41f
commit a2e9f5efcb
5 changed files with 10 additions and 6 deletions

View File

@ -864,8 +864,7 @@ BOOL mac_pre_connect(freerdp *instance)
if (!settings->ServerHostname)
{
WLog_ERR(TAG, "error: server hostname was not specified with /v:<server>[:port]");
[NSApp terminate:nil];
return -1;
return FALSE;
}
settings->OsMajorType = OSMAJORTYPE_MACINTOSH;

View File

@ -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

View File

@ -8,7 +8,7 @@
#import <Cocoa/Cocoa.h>
int main(int argc, char *argv[])
int main(int argc, const char *argv[])
{
return NSApplicationMain(argc, argv);
}

View File

@ -19,7 +19,7 @@
#import <Cocoa/Cocoa.h>
int main(int argc, char *argv[])
int main(int argc, const char *argv[])
{
return NSApplicationMain(argc, (const char **)argv);
return NSApplicationMain(argc, argv);
}

View File

@ -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;
}