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

Add sanity checks to try to track down crash

parent d8dbef2e
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -2500,6 +2500,7 @@ static NSTimeInterval kMinimumPartialLineTriggerCheckInterval = 0.5;
[self setProfile:updatedProfile];
return;
}
[self sanityCheck];
 
// Copy non-overridden fields over.
NSMutableDictionary *temp = [NSMutableDictionary dictionaryWithDictionary:_profile];
Loading
Loading
@@ -2538,6 +2539,15 @@ static NSTimeInterval kMinimumPartialLineTriggerCheckInterval = 0.5;
[[ProfileModel sessionsInstance] setBookmark:temp withGuid:temp[KEY_GUID]];
[self setPreferencesFromAddressBookEntry:temp];
[self setProfile:temp];
[self sanityCheck];
}
- (void)sanityCheck {
if (_isDivorced) {
NSDictionary *sessionsProfile =
[[ProfileModel sessionsInstance] bookmarkWithGuid:_profile[KEY_GUID]];
assert(sessionsProfile);
}
}
 
- (void)sessionProfileDidChange
Loading
Loading
@@ -2547,6 +2557,8 @@ static NSTimeInterval kMinimumPartialLineTriggerCheckInterval = 0.5;
}
NSDictionary *updatedProfile =
[[ProfileModel sessionsInstance] bookmarkWithGuid:_profile[KEY_GUID]];
[self sanityCheck];
NSMutableSet *keys = [NSMutableSet setWithArray:[updatedProfile allKeys]];
[keys addObjectsFromArray:[_profile allKeys]];
for (NSString *aKey in keys) {
Loading
Loading
@@ -2567,10 +2579,12 @@ static NSTimeInterval kMinimumPartialLineTriggerCheckInterval = 0.5;
[self setProfile:updatedProfile];
[[NSNotificationCenter defaultCenter] postNotificationName:kSessionProfileDidChange
object:_profile[KEY_GUID]];
[self sanityCheck];
}
 
- (BOOL)reloadProfile
{
[self sanityCheck];
DLog(@"Reload profile for %@", self);
BOOL didChange = NO;
NSDictionary *sharedProfile = [[ProfileModel sharedInstance] bookmarkWithGuid:_originalProfile[KEY_GUID]];
Loading
Loading
@@ -2592,6 +2606,7 @@ static NSTimeInterval kMinimumPartialLineTriggerCheckInterval = 0.5;
}
 
_textview.badgeLabel = [self badgeLabel];
[self sanityCheck];
return didChange;
}
 
Loading
Loading
@@ -3605,6 +3620,7 @@ static NSTimeInterval kMinimumPartialLineTriggerCheckInterval = 0.5;
toName:profile[KEY_NAME]];
_tmuxTitleOutOfSync = NO;
}
[self sanityCheck];
}
 
- (void)synchronizeTmuxFonts:(NSNotification *)notification
Loading
Loading
@@ -3686,6 +3702,7 @@ static NSTimeInterval kMinimumPartialLineTriggerCheckInterval = 0.5;
 
- (void)setSessionSpecificProfileValues:(NSDictionary *)newValues
{
[self sanityCheck];
if (!_isDivorced) {
[self divorceAddressBookEntryFromPreferences];
}
Loading
Loading
@@ -3745,6 +3762,7 @@ static NSTimeInterval kMinimumPartialLineTriggerCheckInterval = 0.5;
[_overriddenFields removeAllObjects];
[_overriddenFields addObjectsFromArray:@[ KEY_GUID, KEY_ORIGINAL_GUID] ];
[self setProfile:[[ProfileModel sessionsInstance] bookmarkWithGuid:guid]];
[self sanityCheck];
return guid;
}
 
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