]> git.street.me.uk Git - andy/viking.git/commitdiff
Fix odd issue with waypoint symbol not getting set on copy.
authorRob Norris <rw_norris@hotmail.com>
Thu, 25 Oct 2012 20:23:31 +0000 (21:23 +0100)
committerRob Norris <rw_norris@hotmail.com>
Sat, 5 Jan 2013 12:47:39 +0000 (12:47 +0000)
For some reason this only happens after the description field was added to the Waypoint.
The old method messes with the memory somehow, so now go for a simple copy of the individual fields.

src/vikwaypoint.c

index 3649caeb2d2a64a73c9894d90876837e9410c852..b91243595e5803463540a62dbf75f714f7989b9c 100644 (file)
@@ -115,7 +115,9 @@ void vik_waypoint_free(VikWaypoint *wp)
 VikWaypoint *vik_waypoint_copy(const VikWaypoint *wp)
 {
   VikWaypoint *new_wp = vik_waypoint_new();
-  *new_wp = *wp;
+  new_wp->coord = wp->coord;
+  new_wp->visible = wp->visible;
+  new_wp->altitude = wp->altitude;
   vik_waypoint_set_name(new_wp,wp->name);
   vik_waypoint_set_comment(new_wp,wp->comment);
   vik_waypoint_set_description(new_wp,wp->description);