diff --git a/PBGitGrapher.h b/PBGitGrapher.h index 2e4af81..ccc65c3 100644 --- a/PBGitGrapher.h +++ b/PBGitGrapher.h @@ -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 diff --git a/PBGitGrapher.mm b/PBGitGrapher.mm index 02216fa..e1b8d88 100644 --- a/PBGitGrapher.mm +++ b/PBGitGrapher.mm @@ -25,12 +25,9 @@ using namespace std; - (id) initWithRepository: (PBGitRepository*) repo { refs = repo.refs; - repository = repo; - pl = new std::list; + pl = new std::list; 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 *lanes = (std::list *)pl; + std::list::iterator it = lanes->begin(); + for (; it != lanes->end(); ++it) + delete *it; + + delete lanes; + [super finalize]; } @end