Skip to content

Commit d37f322

Browse files
committed
Merge pull request #168 from ksuther/master
Crash and a minor fix
2 parents d060214 + 1db49ab commit d37f322

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

PBGitSidebarController.m

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ - (void)awakeFromNib
6565
commitViewController = [[PBGitCommitController alloc] initWithRepository:repository superController:superController];
6666
stashViewController = [[PBStashContentController alloc] initWithRepository:repository superController:superController];
6767

68-
[stashViewController loadView];
68+
[historyViewController view]; //preload historyViewController so the contextual menus in the sidebar work
69+
[stashViewController view];
6970

7071
[repository addObserver:self forKeyPath:@"refs" options:0 context:@"updateRefs"];
7172
[repository addObserver:self forKeyPath:@"currentBranch" options:0 context:@"currentBranchChange"];
@@ -137,6 +138,8 @@ - (void) observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(
137138
}
138139
} else if ([kObservingContextSubmodules isEqualToString:(__bridge NSString *)context]) {
139140
[submodules.children removeAllObjects];
141+
[sourceView reloadData]; //reload now otherwise the outline view may crash while loading old objects
142+
140143
NSArray *newSubmodules = [change objectForKey:NSKeyValueChangeNewKey];
141144

142145
for (PBGitSubmodule *submodule in newSubmodules) {

0 commit comments

Comments
 (0)