Dereference the prices used in function convert_price

The two prices used in convert_price had there reference count
increased in extract_common_prices. This lead to the reference count
continuously increasing and not being freed on close so add
gnc_price_unref on both prices to reduce the reference count.
pull/1088/head
Robert Fewell 5 years ago
parent 77cf90f198
commit cacdb12aa5

@ -2488,6 +2488,9 @@ convert_price (const gnc_commodity *from, const gnc_commodity *to, PriceTuple tu
price = gnc_numeric_div (to_val, from_val, GNC_DENOM_AUTO, no_round);
gnc_price_unref (tuple.from);
gnc_price_unref (tuple.to);
if (from_cur == from && to_cur == to)
return price;

Loading…
Cancel
Save