summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 69875c8)
raw | patch | inline | side by side (parent: 69875c8)
| author | mental <mental@users.sourceforge.net> | |
| Tue, 9 May 2006 04:38:53 +0000 (04:38 +0000) | ||
| committer | mental <mental@users.sourceforge.net> | |
| Tue, 9 May 2006 04:38:53 +0000 (04:38 +0000) |
| ChangeLog | patch | blob | history | |
| src/display/curve.cpp | patch | blob | history |
diff --git a/ChangeLog b/ChangeLog
index 63842331b1bf9ea293a0212996a537e05fcd7ed3..e24114c868e77a65e43684c72c1618a83c2c061e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
containing connectors if they were loaded from the file chooser
or from the recent file list. Fixes bug #1458820.
+2006-05-08 MenTaLguY <mental@rydia.net>
+
+ * src/display/curve.cpp:
+
+ always make local copy of path data so that we have control over memory
+ policy
+
2006-05-08 MenTaLguY <mental@rydia.net>
* src/display/curve.h, src/display/curve.cpp, src/dropper-context.cpp:
diff --git a/src/display/curve.cpp b/src/display/curve.cpp
index aa899b902b64d161ee3585bfafcafa3f66345086..3e491a2b8a67114ee040b66e2e1bdfd5af44a242 100644 (file)
--- a/src/display/curve.cpp
+++ b/src/display/curve.cpp
{
g_return_val_if_fail(bpath != NULL, NULL);
- if (!sp_bpath_good(bpath)) {
- NArtBpath *new_bpath = sp_bpath_clean(bpath);
- if (new_bpath == NULL) {
- return NULL;
- }
- nr_free(bpath);
- bpath = new_bpath;
- }
-
- SPCurve *curve = g_new(SPCurve, 1);
-
- curve->refcount = 1;
- curve->_bpath = bpath;
- curve->length = sp_bpath_length(bpath);
- curve->end = curve->length - 1;
- gint i = curve->end;
- for (; i > 0; i--)
- if ((curve->_bpath[i].code == NR_MOVETO) ||
- (curve->_bpath[i].code == NR_MOVETO_OPEN))
- break;
- curve->substart = i;
- curve->hascpt = false;
- curve->posSet = false;
- curve->moving = false;
- curve->closed = sp_bpath_closed(bpath);
-
+ SPCurve *curve = sp_curve_new_from_foreign_bpath(bpath);
+ nr_free(bpath);
return curve;
}
memcpy(new_bpath, bpath, len * sizeof(NArtBpath));
}
- SPCurve *curve = sp_curve_new_from_bpath(new_bpath);
+ SPCurve *curve = g_new(SPCurve, 1);
- if (!curve)
- nr_free(new_bpath);
+ curve->refcount = 1;
+ curve->_bpath = new_bpath;
+ curve->length = sp_bpath_length(new_bpath);
+ curve->end = curve->length - 1;
+ gint i = curve->end;
+ for (; i > 0; i--)
+ if ((curve->_bpath[i].code == NR_MOVETO) ||
+ (curve->_bpath[i].code == NR_MOVETO_OPEN))
+ break;
+ curve->substart = i;
+ curve->hascpt = false;
+ curve->posSet = false;
+ curve->moving = false;
+ curve->closed = sp_bpath_closed(new_bpath);
return curve;
}