aboutsummaryrefslogtreecommitdiffstats
path: root/dive.c
diff options
context:
space:
mode:
Diffstat (limited to 'dive.c')
-rw-r--r--dive.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/dive.c b/dive.c
index 83ec161c6..8dc43223e 100644
--- a/dive.c
+++ b/dive.c
@@ -2357,6 +2357,20 @@ static void free_pic(struct picture *picture)
}
}
+// When handling pictures in different threads, we need to copy them so we don't
+// run into problems when the main thread frees the picture.
+
+struct picture *clone_picture(struct picture *src)
+{
+ struct picture *dst;
+
+ dst = alloc_picture();
+ copy_pl(src, dst);
+ return dst;
+}
+
+
+
static int same_sample(struct sample *a, struct sample *b)
{
if (a->time.seconds != b->time.seconds)
@@ -3387,7 +3401,7 @@ void dive_set_geodata_from_picture(struct dive *dive, struct picture *picture)
}
}
-static void picture_free(struct picture *picture)
+void picture_free(struct picture *picture)
{
if (!picture)
return;