From 42a1c0396865a7e606b9d0b35fee7aaa3ebf7166 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Sun, 4 Apr 2004 23:59:20 +0000 Subject: *** empty log message *** --- amount.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'amount.cc') diff --git a/amount.cc b/amount.cc index 22c3816d..d6724640 100644 --- a/amount.cc +++ b/amount.cc @@ -229,19 +229,23 @@ amount * gmp_amount::street(bool get_quotes) const int max = 10; while (--max >= 0) { - if (! amt->commdty()->price) { + if (! amt->commdty()->price && ! amt->commdty()->sought) { if (get_quotes) get_commodity_price(amt->commdty()); + amt->commdty()->sought = true; if (! amt->commdty()->price) break; } amount * old = amt; amt = amt->value(amt->commdty()->price); - delete old; - if (amt->commdty() == old->commdty()) + if (amt->commdty() == old->commdty()) { + delete old; break; + } + + delete old; } return amt; -- cgit v1.2.3