Skip to content
Snippets Groups Projects
Commit acde36f8 authored by George Nachman's avatar George Nachman
Browse files

Avoid updating touchbar during dealloc.

A better solution would be to remove the delegate from the tabbar during dealloc but I'm scared of what might change.
parent bc2c6872
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -16,6 +16,7 @@ ITERM_IGNORE_PARTIAL_BEGIN
@property (nonatomic, retain) NSCustomTouchBarItem *tabsTouchBarItem;
@property (nonatomic, retain) NSCandidateListTouchBarItem<NSString *> *autocompleteCandidateListItem;
ITERM_IGNORE_PARTIAL_END
@property(nonatomic, readonly) BOOL wellFormed;
 
// This is a reference to the window's content view, here for convenience because it has
// the right type.
Loading
Loading
Loading
Loading
@@ -9,6 +9,7 @@
#import "PseudoTerminal+TouchBar.h"
#import "PseudoTerminal+Private.h"
 
#import "DebugLogging.h"
#import "NSDictionary+iTerm.h"
#import "NSImage+iTerm.h"
#import "iTermColorPresets.h"
Loading
Loading
@@ -96,6 +97,10 @@ ITERM_IGNORE_PARTIAL_BEGIN
}
 
- (void)updateTouchBarIfNeeded {
if (!self.wellFormed) {
DLog(@"Not updating touch bar in %@ because not well formed", self);
return;
}
if (IsTouchBarAvailable()) {
NSTouchBar *replacement = [self amendTouchBar:[self makeGenericTouchBar]];
if (![replacement.customizationIdentifier isEqualToString:self.touchBar.customizationIdentifier]) {
Loading
Loading
Loading
Loading
@@ -288,7 +288,6 @@ static NSRect iTermRectCenteredVerticallyWithinRect(NSRect frameToCenter, NSRect
IBOutlet NSButton *coprocessIgnoreErrors_;
 
NSDictionary *lastArrangement_;
BOOL wellFormed_;
 
BOOL exitingLionFullscreen_;
 
Loading
Loading
@@ -705,7 +704,7 @@ static NSRect iTermRectCenteredVerticallyWithinRect(NSRect frameToCenter, NSRect
// Update the collection behavior.
self.hotkeyWindowType = hotkeyWindowType;
 
wellFormed_ = YES;
_wellFormed = YES;
[[self window] setRestorable:YES];
[[self window] setRestorationClass:[PseudoTerminalRestorer class]];
self.terminalGuid = [NSString stringWithFormat:@"pty-%@", [NSString uuid]];
Loading
Loading
@@ -776,7 +775,7 @@ ITERM_WEAKLY_REFERENCEABLE
 
[self closeInstantReplayWindow];
doNotSetRestorableState_ = YES;
wellFormed_ = NO;
_wellFormed = NO;
 
// Do not assume that [self window] is valid here. It may have been freed.
[[NSNotificationCenter defaultCenter] removeObserver:self];
Loading
Loading
@@ -7530,7 +7529,7 @@ ITERM_WEAKLY_REFERENCEABLE
[[self ptyWindow] setRestoreState:nil];
return;
}
if (wellFormed_) {
if (_wellFormed) {
[lastArrangement_ release];
NSTimeInterval start = [NSDate timeIntervalSinceReferenceDate];
BOOL includeContents = [iTermAdvancedSettingsModel restoreWindowContents];
Loading
Loading
Loading
Loading
@@ -177,7 +177,7 @@ DEFINE_SETTABLE_BOOL(suppressRestartAnnouncement, SuppressRestartAnnouncement, N
DEFINE_BOOL(showSessionRestoredBanner, YES, @"Session: When restoring a session without restoring a running job, draw a banner saying “Session Restored” below the restored contents.");
DEFINE_STRING(autoLogFormat,
@"\\(session.creationTimeString).\\(session.name).\\(session.termid).\\(iterm2.pid).\\(session.autoLogId).log",
@"Session: Format for automatic session log filenames. See the Badges documentation for supported substitutions.");
@"Session: Format for automatic session log filenames.\nSee the Badges documentation for supported substitutions.");
 
 
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment