model: hack dumpGraph() bug by "leaking" promises
authorBrian Norris <banorris@uci.edu>
Sat, 2 Mar 2013 22:49:00 +0000 (14:49 -0800)
committerBrian Norris <banorris@uci.edu>
Sat, 2 Mar 2013 22:54:50 +0000 (14:54 -0800)
commitddb5900f2e0dbde556fd320960f048965cf4f2c2
treed25819cdf4de105c533d8f6cd1f349cfca3eae48
parent438b20cfc07029629c03b4f219c190cbdb5b9d1b
model: hack dumpGraph() bug by "leaking" promises

It is possible to end up in an inconsistent state, where a "resolved"
promise may still be referenced if CycleGraph::resolvePromise() failed,
so don't delete 'promise'. Technically, this leaks memory within an
execution, but because it is allocated on the snapshotting heap, this
leak goes away after an execution ends. So, rather than spending more
work on "fixing" the inconsistency, just don't delete the promise yet.

This inconsistency only matters when dumping the mo_graph to file, since
it traverses all the ModelAction/Promise edges, including those that are
semi-dangling mid-merge.
model.cc