[gegl] gegl: GeglPath make more robust for threaded use
- From: Øyvind "pippin" Kolås <ok src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl] gegl: GeglPath make more robust for threaded use
- Date: Thu, 20 Dec 2018 14:09:56 +0000 (UTC)
commit 115c7586fcf7ba6cd23bdfe6968bde40198839b2
Author: Øyvind Kolås <pippin gimp org>
Date: Thu Dec 20 14:50:53 2018 +0100
gegl: GeglPath make more robust for threaded use
The freeing of the old flat path before constructing a replacement
means there is a gap in time where the flat path contains garbage
data, this fixes that.
gegl/property-types/gegl-path.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/gegl/property-types/gegl-path.c b/gegl/property-types/gegl-path.c
index 6a08cb5e1..b49803776 100644
--- a/gegl/property-types/gegl-path.c
+++ b/gegl/property-types/gegl-path.c
@@ -1105,12 +1105,13 @@ ensure_flattened (GeglPath *vector)
gint i;
GeglPathList *path = priv->path;
GeglPathList *new_path;
+ GeglPathList *old_path = NULL;
GeglPathClass *klass= GEGL_PATH_GET_CLASS (vector);
if (priv->flat_path_clean)
return;
if (priv->flat_path)
- gegl_path_list_destroy (priv->flat_path);
+ old_path = priv->flat_path;
for (i=0;klass->flattener[i];i++)
{
@@ -1124,6 +1125,8 @@ ensure_flattened (GeglPath *vector)
}
priv->flat_path = gegl_path_list_flatten (&priv->matrix, path);
+ if (old_path)
+ gegl_path_list_destroy (old_path);
if (path != priv->path)
gegl_path_list_destroy (path);
priv->flat_path_clean = TRUE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]