From a970dc423d59ea844bdb1af48d5d9419a5e2a287 Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Sun, 13 Oct 2013 00:24:05 +0200 Subject: Units: stop newing Unit objects. pass around pointers to "undeletable" Unit objects in the UnitTable. I think we should move to using indexed units, and pass around the index of the unit in the unittable, or smth like that... ? (bzr r12679) --- src/live_effects/parameter/unit.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/live_effects/parameter/unit.cpp') diff --git a/src/live_effects/parameter/unit.cpp b/src/live_effects/parameter/unit.cpp index 561766920..0ee553e2c 100644 --- a/src/live_effects/parameter/unit.cpp +++ b/src/live_effects/parameter/unit.cpp @@ -24,7 +24,7 @@ UnitParam::UnitParam( const Glib::ustring& label, const Glib::ustring& tip, Effect* effect, Glib::ustring default_unit) : Parameter(label, tip, key, wr, effect) { - defunit = new Inkscape::Util::Unit(unit_table.getUnit(default_unit)); + defunit = unit_table.getUnit(default_unit); unit = defunit; } @@ -36,7 +36,7 @@ bool UnitParam::param_readSVGValue(const gchar * strvalue) { if (strvalue) { - param_set_value(unit_table.getUnit(strvalue)); + param_set_value(*unit_table.getUnit(strvalue)); return true; } return false; -- cgit v1.2.3