From 96b9972307df568be99319edd12d593cab90f521 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benoi=CC=82t=20LeBlanc?= Date: Tue, 2 Jul 2013 16:13:43 -0400 Subject: [PATCH] MacFreeRDP: fixed crash when opening second session MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (unrecognized selector sent to instance … ) --- client/Mac/MRDPView.m | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/client/Mac/MRDPView.m b/client/Mac/MRDPView.m index d4020679f..6a67fbfcf 100644 --- a/client/Mac/MRDPView.m +++ b/client/Mac/MRDPView.m @@ -788,8 +788,18 @@ struct rgba_data outerRect.size.height = h + heightDiff; [[self window] setMaxSize:outerRect.size]; [[self window] setMinSize:outerRect.size]; - [[self window] setFrame:outerRect display:YES]; - + + @try + { + [[self window] setFrame:outerRect display:YES]; + } + @catch (NSException * e) { + NSLog(@"Exception: %@", e); + } + @finally { + NSLog(@"finally"); + } + // set client area to specified dimensions innerRect.size.width = w; innerRect.size.height = h; @@ -874,8 +884,7 @@ BOOL mac_pre_connect(freerdp* instance) settings->OrderSupport[NEG_ELLIPSE_SC_INDEX] = FALSE; settings->OrderSupport[NEG_ELLIPSE_CB_INDEX] = FALSE; - [view setViewSize :instance->settings->DesktopWidth :instance->settings->DesktopHeight]; - + [view setViewSize :instance->settings->DesktopWidth :instance->settings->DesktopHeight]; freerdp_channels_pre_connect(instance->context->channels, instance); return TRUE; @@ -933,9 +942,6 @@ BOOL mac_post_connect(freerdp* instance) view->pasteboard_rd = [NSPasteboard generalPasteboard]; view->pasteboard_changecount = (int) [view->pasteboard_rd changeCount]; view->pasteboard_timer = [NSTimer scheduledTimerWithTimeInterval:0.5 target:mfc->view selector:@selector(onPasteboardTimerFired:) userInfo:nil repeats:YES]; - - /* we want to be notified when window resizes */ - [[NSNotificationCenter defaultCenter] addObserver:mfc->view selector:@selector(windowDidResize:) name:NSWindowDidResizeNotification object:nil]; return TRUE; }