diff --git a/src/MacVim/MMWindowController.m b/src/MacVim/MMWindowController.m index 94ca435f9f..1ecb4f8973 100644 --- a/src/MacVim/MMWindowController.m +++ b/src/MacVim/MMWindowController.m @@ -245,11 +245,13 @@ - (void)dealloc ASLogDebug(@""); [decoratedWindow release]; decoratedWindow = nil; + [fullScreenWindow release]; fullScreenWindow = nil; [windowAutosaveKey release]; windowAutosaveKey = nil; [vimView release]; vimView = nil; [toolbar release]; toolbar = nil; // in case processAfterWindowPresentedQueue wasn't called [afterWindowPresentedQueue release]; afterWindowPresentedQueue = nil; + [lastSetTitle release]; lastSetTitle = nil; [super dealloc]; } @@ -461,8 +463,9 @@ - (void)zoomWithRows:(int)rows columns:(int)cols state:(int)state - (void)setTitle:(NSString *)title { // Save the original title, if we haven't already. + [title retain]; // retain the title first before release lastSetTitle, since you can call setTitle on lastSetTitle itself. [lastSetTitle release]; - lastSetTitle = [title retain]; + lastSetTitle = title; // While in live resize the window title displays the dimensions of the // window so don't clobber this with the new title. We have already set @@ -934,10 +937,6 @@ - (void)enterFullScreen:(int)fuoptions backgroundColor:(NSColor *)back // Enter custom full-screen mode. ASLogInfo(@"Enter custom full-screen"); - // fullScreenWindow could be non-nil here if this is called multiple - // times during startup. - [fullScreenWindow release]; - NSColor *fullscreenBg = back; // See setDefaultColorsBackground: for why set a transparent @@ -946,6 +945,10 @@ - (void)enterFullScreen:(int)fuoptions backgroundColor:(NSColor *)back fullscreenBg = [fullscreenBg colorWithAlphaComponent:0.001]; } + // fullScreenWindow could be non-nil here if this is called multiple + // times during startup. + [fullScreenWindow release]; + fullScreenWindow = [[MMFullScreenWindow alloc] initWithWindow:decoratedWindow view:vimView backgroundColor:fullscreenBg]; [fullScreenWindow setOptions:fuoptions];