mirror of
https://github.com/kennethreitz-archive/gitx.git
synced 2026-06-05 23:40:18 +00:00
GitGrapher: free pointers on dealloc
This frees the std vector and its contents on dealloc. We also fresh up the header a bit
This commit is contained in:
+4
-6
@@ -12,15 +12,13 @@
|
||||
#import "PBGraphCellInfo.h"
|
||||
|
||||
@interface PBGitGrapher : NSObject {
|
||||
PBGraphCellInfo* previous;
|
||||
PBGraphCellInfo *previous;
|
||||
void *pl;
|
||||
void *storage;
|
||||
int curLane;
|
||||
|
||||
NSDictionary* refs;
|
||||
PBGitRepository* repository;
|
||||
NSDictionary *refs;
|
||||
}
|
||||
|
||||
- (id) initWithRepository: (PBGitRepository*) repo;
|
||||
- (void) decorateCommit: (PBGitCommit *) commit;
|
||||
- (id) initWithRepository:(PBGitRepository *)repo;
|
||||
- (void) decorateCommit:(PBGitCommit *)commit;
|
||||
@end
|
||||
|
||||
+8
-4
@@ -25,12 +25,9 @@ using namespace std;
|
||||
- (id) initWithRepository: (PBGitRepository*) repo
|
||||
{
|
||||
refs = repo.refs;
|
||||
repository = repo;
|
||||
pl = new std::list<PBGitLane>;
|
||||
pl = new std::list<PBGitLane *>;
|
||||
|
||||
PBGitLane::resetColors();
|
||||
//[PBGitLane resetColors];
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
@@ -161,6 +158,13 @@ void add_line(struct PBGitGraphLine *lines, int *nLines, int upper, int from, in
|
||||
|
||||
- (void) finalize
|
||||
{
|
||||
std::list<PBGitLane *> *lanes = (std::list<PBGitLane *> *)pl;
|
||||
std::list<PBGitLane *>::iterator it = lanes->begin();
|
||||
for (; it != lanes->end(); ++it)
|
||||
delete *it;
|
||||
|
||||
delete lanes;
|
||||
|
||||
[super finalize];
|
||||
}
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user