summaryrefslogtreecommitdiffstats
path: root/src/ui
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2014-02-05 16:31:55 +0000
committerJabiertxof <jtx@jtx.marker.es>2014-02-05 16:31:55 +0000
commitb9f1c85c61ce91fedca5486ef371bf6301e76128 (patch)
treeeab77366a1f4111c10204eee3f8d89e73f484705 /src/ui
parentupdate to trunk (diff)
downloadinkscape-b9f1c85c61ce91fedca5486ef371bf6301e76128.tar.gz
inkscape-b9f1c85c61ce91fedca5486ef371bf6301e76128.zip
fixing su_v advertising memory bug
(bzr r11950.1.247)
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/tools/freehand-base.cpp37
1 files changed, 24 insertions, 13 deletions
diff --git a/src/ui/tools/freehand-base.cpp b/src/ui/tools/freehand-base.cpp
index 5825a149c..6561a0c2f 100644
--- a/src/ui/tools/freehand-base.cpp
+++ b/src/ui/tools/freehand-base.cpp
@@ -531,22 +531,33 @@ void spdc_concat_colors_and_flush(FreehandBase *dc, gboolean forceclosed)
// Step C - test start
if (dc->sa) {
- SPCurve *s = dc->sa->curve;
- dc->white_curves = g_slist_remove(dc->white_curves, s);
- if (dc->sa->start) {
- s = reverse_then_unref(s);
+ Inkscape::Preferences *prefs = Inkscape::Preferences::get();
+ if(prefs->getInt(tool_name(dc) + "/freehand-mode", 0) != 1 &&
+ prefs->getInt(tool_name(dc) + "/freehand-mode", 0) != 2){
+ dc->sa->curve->unref()
+ }else{
+ SPCurve *s = dc->sa->curve;
+ dc->white_curves = g_slist_remove(dc->white_curves, s);
+ if (dc->sa->start) {
+ s = reverse_then_unref(s);
+ }
+ s->append_continuous(c, 0.0625);
+ c->unref();
+ c = s;
}
- s->append_continuous(c, 0.0625);
- c->unref();
- c = s;
} else /* Step D - test end */ if (dc->ea) {
- SPCurve *e = dc->ea->curve;
- dc->white_curves = g_slist_remove(dc->white_curves, e);
- if (!dc->ea->start) {
- e = reverse_then_unref(e);
+ Inkscape::Preferences *prefs = Inkscape::Preferences::get();
+ if(prefs->getInt(tool_name(dc) + "/freehand-mode", 0) != 1 &&
+ prefs->getInt(tool_name(dc) + "/freehand-mode", 0) != 2){
+ dc->ea->curve->unref()
+ SPCurve *e = dc->ea->curve;
+ dc->white_curves = g_slist_remove(dc->white_curves, e);
+ if (!dc->ea->start) {
+ e = reverse_then_unref(e);
+ }
+ c->append_continuous(e, 0.0625);
+ e->unref();
}
- c->append_continuous(e, 0.0625);
- e->unref();
}