summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrandomguy3 <randomguy3@7c02a99a-9b00-45e3-bf44-6f3dd7fddb64>2012-01-17 18:14:07 +0000
committerrandomguy3 <randomguy3@7c02a99a-9b00-45e3-bf44-6f3dd7fddb64>2012-01-17 18:14:07 +0000
commit18871fdd7bbfb43eb0971ee358554f321f789eee (patch)
treed84e76ccdb9f910a89e08aeaf5659594393a47f2
parent495427773173469adc66188ce6fd30f0a72e9830 (diff)
Don't crash
git-svn-id: https://tikzit.svn.sourceforge.net/svnroot/tikzit/trunk@387 7c02a99a-9b00-45e3-bf44-6f3dd7fddb64
-rw-r--r--tikzit/src/common/Graph.m17
1 files changed, 8 insertions, 9 deletions
diff --git a/tikzit/src/common/Graph.m b/tikzit/src/common/Graph.m
index e83a99c..8bf8dfa 100644
--- a/tikzit/src/common/Graph.m
+++ b/tikzit/src/common/Graph.m
@@ -465,7 +465,7 @@
}
}
}
-
+
[graphLock unlock];
}
@@ -481,16 +481,16 @@
- (Graph*)copyOfSubgraphWithNodes:(NSSet*)nds {
[graphLock lock];
-
+
NSMapTable *newNds = [Graph nodeTableForNodes:nds];
Graph* newGraph = [[Graph graph] retain];
-
+
NSEnumerator *en = [newNds objectEnumerator];
Node *nd;
while ((nd = [en nextObject])) {
[newGraph addNode:nd];
}
-
+
en = [edges objectEnumerator];
Edge *e;
while ((e = [en nextObject])) {
@@ -502,20 +502,20 @@
[e1 release]; // e1 belongs to newGraph
}
}
-
+
[graphLock unlock];
-
+
return newGraph;
}
- (NSSet*)pathCover {
[self sync];
- NSMutableSet *remainingEdges = [NSMutableSet setWithArray:edges];
NSMutableSet *cover = [NSMutableSet set];
-
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ NSMutableSet *remainingEdges = [NSMutableSet setWithArray:edges];
+
while ([remainingEdges count] != 0) {
NSMutableArray *path = [[NSMutableArray alloc] init];
NSSet *succs;
@@ -542,7 +542,6 @@
}
[pool drain];
- [remainingEdges release];
return cover;
}