summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJabier Arraiza <jabier.arraiza@marker.es>2018-11-04 16:11:37 +0000
committerJabier Arraiza <jabier.arraiza@marker.es>2018-11-05 21:09:14 +0000
commitb8db3fe79b8509d18a4660c553848c740ca046bb (patch)
treeef2c696946477ab2875a3286ce9195e9e56e5da3 /src
parentRemove unused header. (diff)
downloadinkscape-b8db3fe79b8509d18a4660c553848c740ca046bb.tar.gz
inkscape-b8db3fe79b8509d18a4660c553848c740ca046bb.zip
Fixing bad destruction of Fillet Chamfer LPE items
Diffstat (limited to 'src')
-rw-r--r--src/live_effects/lpe-fillet-chamfer.cpp14
-rw-r--r--src/live_effects/lpe-fillet-chamfer.h3
2 files changed, 5 insertions, 12 deletions
diff --git a/src/live_effects/lpe-fillet-chamfer.cpp b/src/live_effects/lpe-fillet-chamfer.cpp
index 8e07388f5..ad489042b 100644
--- a/src/live_effects/lpe-fillet-chamfer.cpp
+++ b/src/live_effects/lpe-fillet-chamfer.cpp
@@ -83,13 +83,7 @@ LPEFilletChamfer::LPEFilletChamfer(LivePathEffectObject *lpeobject)
chamfer_steps.param_set_increments(1, 1);
chamfer_steps.param_set_digits(0);
_provides_knotholder_entities = true;
- previous_unit = NULL;
-}
-
-LPEFilletChamfer::~LPEFilletChamfer() {
- if(previous_unit) {
- g_free(previous_unit);
- }
+ previous_unit = Glib::ustring("");
}
void LPEFilletChamfer::doOnApply(SPLPEItem const *lpeItem)
@@ -379,11 +373,11 @@ void LPEFilletChamfer::doBeforeEffect(SPLPEItem const *lpeItem)
_pathvector_satellites->setSatellites(satellites);
satellites_param.setPathVectorSatellites(_pathvector_satellites, write);
refreshKnots();
- gchar const *current_unit = unit.get_abbreviation();
- if (previous_unit && strcmp(previous_unit, current_unit) ) {
+ Glib::ustring current_unit = Glib::ustring(unit.get_abbreviation());
+ if (previous_unit != current_unit) {
updateAmount();
}
- previous_unit = const_cast<gchar *>(current_unit);
+ previous_unit = current_unit;
} else {
g_warning("LPE Fillet can only be applied to shapes (not groups).");
}
diff --git a/src/live_effects/lpe-fillet-chamfer.h b/src/live_effects/lpe-fillet-chamfer.h
index 4ec882799..cb8a859fc 100644
--- a/src/live_effects/lpe-fillet-chamfer.h
+++ b/src/live_effects/lpe-fillet-chamfer.h
@@ -33,7 +33,6 @@ enum Filletmethod {
class LPEFilletChamfer : public Effect {
public:
LPEFilletChamfer(LivePathEffectObject *lpeobject);
- ~LPEFilletChamfer();
void doBeforeEffect(SPLPEItem const *lpeItem) override;
Geom::PathVector doEffect_path(Geom::PathVector const &path_in) override;
void doOnApply(SPLPEItem const *lpeItem) override;
@@ -65,7 +64,7 @@ private:
bool _degenerate_hide;
PathVectorSatellites *_pathvector_satellites;
Geom::PathVector _hp;
- gchar * previous_unit;
+ Glib::ustring previous_unit;
LPEFilletChamfer(const LPEFilletChamfer &);
LPEFilletChamfer &operator=(const LPEFilletChamfer &);