Skip to content

Commit 515b66f

Browse files
committed
Fix memory leaks
1 parent cad9281 commit 515b66f

File tree

5 files changed

+47
-17
lines changed

5 files changed

+47
-17
lines changed

GLFileView.m

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ - (void) showFile
7878
[script callWebScriptMethod:@"showFile" withArguments:[NSArray arrayWithObject:fileTxt]];
7979
}
8080

81-
#ifdef DEBUG
81+
#if 0
8282
NSString *dom=[[[[view mainFrame] DOMDocument] documentElement] outerHTML];
8383
NSString *tmpFile=@"~/tmp/test.html";
8484
[dom writeToFile:[tmpFile stringByExpandingTildeInPath] atomically:true encoding:NSUTF8StringEncoding error:nil];
@@ -151,6 +151,13 @@ - (void) didLoad
151151
[self showFile];
152152
}
153153

154+
- (void)closeView
155+
{
156+
[historyController.treeController removeObserver:self forKeyPath:@"selection"];
157+
158+
[super closeView];
159+
}
160+
154161
- (NSString *) parseHTML:(NSString *)txt
155162
{
156163
txt=[txt stringByReplacingOccurrencesOfString:@"&" withString:@"&"];

GitX.xcodeproj/project.pbxproj

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1158,7 +1158,14 @@
11581158
isa = PBXProject;
11591159
buildConfigurationList = 26FC0A880875C7B200E6366F /* Build configuration list for PBXProject "GitX" */;
11601160
compatibilityVersion = "Xcode 3.1";
1161+
developmentRegion = English;
11611162
hasScannedForEncodings = 1;
1163+
knownRegions = (
1164+
English,
1165+
Japanese,
1166+
French,
1167+
German,
1168+
);
11621169
mainGroup = 29B97314FDCFA39411CA2CEA /* GitTest */;
11631170
projectDirPath = "";
11641171
projectRoot = "";

PBGitHistoryController.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
@class PBRefController;
1919
@class QLPreviewPanel;
2020
@class PBCommitList;
21+
@class GLFileView;
2122
@class PBGitSHA;
2223

2324
@class PBHistorySearchController;
@@ -34,6 +35,7 @@
3435
IBOutlet PBWebHistoryController *webHistoryController;
3536
QLPreviewPanel* previewPanel;
3637
IBOutlet PBHistorySearchController *searchController;
38+
IBOutlet GLFileView *fileView;
3739

3840
IBOutlet PBGitGradientBarView *upperToolbarView;
3941
IBOutlet NSButton *mergeButton;

PBGitHistoryController.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#import "PBHistorySearchController.h"
2424
#define QLPreviewPanel NSClassFromString(@"QLPreviewPanel")
2525
#import "PBQLTextView.h"
26+
#import "GLFileView.h"
2627

2728

2829
#define kHistorySelectedDetailIndexKey @"PBHistorySelectedDetailIndex"
@@ -493,6 +494,7 @@ - (void)closeView
493494
}
494495

495496
[webHistoryController closeView];
497+
[fileView closeView];
496498

497499
[super closeView];
498500
}

PBGitHistoryView.xib

Lines changed: 28 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.10">
33
<data>
44
<int key="IBDocument.SystemTarget">1050</int>
5-
<string key="IBDocument.SystemVersion">10F569</string>
6-
<string key="IBDocument.InterfaceBuilderVersion">788</string>
7-
<string key="IBDocument.AppKitVersion">1038.29</string>
5+
<string key="IBDocument.SystemVersion">10H574</string>
6+
<string key="IBDocument.InterfaceBuilderVersion">804</string>
7+
<string key="IBDocument.AppKitVersion">1038.35</string>
88
<string key="IBDocument.HIToolboxVersion">461.00</string>
99
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
1010
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -15,8 +15,8 @@
1515
</object>
1616
<object class="NSMutableArray" key="dict.values">
1717
<bool key="EncodedWithXMLCoder">YES</bool>
18-
<string>788</string>
19-
<string>788</string>
18+
<string>804</string>
19+
<string>804</string>
2020
</object>
2121
</object>
2222
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
@@ -29,13 +29,8 @@
2929
<string>com.apple.WebKitIBPlugin</string>
3030
</object>
3131
<object class="NSMutableDictionary" key="IBDocument.Metadata">
32-
<bool key="EncodedWithXMLCoder">YES</bool>
33-
<object class="NSArray" key="dict.sortedKeys" id="0">
34-
<bool key="EncodedWithXMLCoder">YES</bool>
35-
</object>
36-
<object class="NSMutableArray" key="dict.values">
37-
<bool key="EncodedWithXMLCoder">YES</bool>
38-
</object>
32+
<string key="NS.key.0">PluginDependencyRecalculationVersion</string>
33+
<integer value="1" key="NS.object.0"/>
3934
</object>
4035
<object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
4136
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -496,7 +491,7 @@
496491
<integer value="1"/>
497492
</object>
498493
</object>
499-
<string key="NS.format">d 'de' MMMM 'de' yyyy HH:mm</string>
494+
<string key="NS.format">MMMM d, yyyy h:mm a</string>
500495
<bool key="NS.natural">NO</bool>
501496
</object>
502497
<reference key="NSControlView" ref="254268962"/>
@@ -1982,13 +1977,23 @@
19821977
</object>
19831978
<int key="connectionID">487</int>
19841979
</object>
1980+
<object class="IBConnectionRecord">
1981+
<object class="IBOutletConnection" key="connection">
1982+
<string key="label">fileView</string>
1983+
<reference key="source" ref="1001"/>
1984+
<reference key="destination" ref="932676109"/>
1985+
</object>
1986+
<int key="connectionID">488</int>
1987+
</object>
19851988
</object>
19861989
<object class="IBMutableOrderedSet" key="objectRecords">
19871990
<object class="NSArray" key="orderedObjects">
19881991
<bool key="EncodedWithXMLCoder">YES</bool>
19891992
<object class="IBObjectRecord">
19901993
<int key="objectID">0</int>
1991-
<reference key="object" ref="0"/>
1994+
<object class="NSArray" key="object" id="0">
1995+
<bool key="EncodedWithXMLCoder">YES</bool>
1996+
</object>
19921997
<reference key="children" ref="1000"/>
19931998
<nil key="parent"/>
19941999
</object>
@@ -2890,7 +2895,7 @@
28902895
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
28912896
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
28922897
<string>com.apple.WebKitIBPlugin</string>
2893-
<string>{{2069, 399}, {955, 434}}</string>
2898+
<string>{{1559, 241}, {955, 434}}</string>
28942899
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
28952900
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
28962901
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
@@ -2928,7 +2933,7 @@
29282933
</object>
29292934
</object>
29302935
<nil key="sourceID"/>
2931-
<int key="maxID">487</int>
2936+
<int key="maxID">488</int>
29322937
</object>
29332938
<object class="IBClassDescriber" key="IBDocument.Classes">
29342939
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
@@ -3267,6 +3272,7 @@
32673272
<string>commitController</string>
32683273
<string>commitList</string>
32693274
<string>fileBrowser</string>
3275+
<string>fileView</string>
32703276
<string>historySplitView</string>
32713277
<string>localRemoteBranchesFilterItem</string>
32723278
<string>mergeButton</string>
@@ -3288,6 +3294,7 @@
32883294
<string>NSArrayController</string>
32893295
<string>PBCommitList</string>
32903296
<string>NSOutlineView</string>
3297+
<string>GLFileView</string>
32913298
<string>PBCollapsibleSplitView</string>
32923299
<string>NSButton</string>
32933300
<string>NSButton</string>
@@ -3312,6 +3319,7 @@
33123319
<string>commitController</string>
33133320
<string>commitList</string>
33143321
<string>fileBrowser</string>
3322+
<string>fileView</string>
33153323
<string>historySplitView</string>
33163324
<string>localRemoteBranchesFilterItem</string>
33173325
<string>mergeButton</string>
@@ -3348,6 +3356,10 @@
33483356
<string key="name">fileBrowser</string>
33493357
<string key="candidateClassName">NSOutlineView</string>
33503358
</object>
3359+
<object class="IBToOneOutletInfo">
3360+
<string key="name">fileView</string>
3361+
<string key="candidateClassName">GLFileView</string>
3362+
</object>
33513363
<object class="IBToOneOutletInfo">
33523364
<string key="name">historySplitView</string>
33533365
<string key="candidateClassName">PBCollapsibleSplitView</string>

0 commit comments

Comments
 (0)