(svn r14265) -Fix (r10750): desyncs after deleting a waypoint because of explicit destructor call instead of using operator delete
authorsmatz
Sun, 07 Sep 2008 18:21:57 +0000
changeset 10089 cbfc938f2538
parent 10088 a87f25ff2b42
child 10090 b6aaa658e2cd
(svn r14265) -Fix (r10750): desyncs after deleting a waypoint because of explicit destructor call instead of using operator delete
src/waypoint.cpp
src/waypoint.h
--- a/src/waypoint.cpp	Sun Sep 07 17:40:14 2008 +0000
+++ b/src/waypoint.cpp	Sun Sep 07 18:21:57 2008 +0000
@@ -293,7 +293,7 @@
 
 	/* Check if we need to delete a waypoint */
 	FOR_ALL_WAYPOINTS(wp) {
-		if (wp->deleted != 0 && --wp->deleted == 0) DeleteWaypoint(wp);
+		if (wp->deleted != 0 && --wp->deleted == 0) delete wp;
 	}
 }
 
--- a/src/waypoint.h	Sun Sep 07 17:40:14 2008 +0000
+++ b/src/waypoint.h	Sun Sep 07 18:21:57 2008 +0000
@@ -44,11 +44,6 @@
 	return index < GetWaypointPoolSize() && GetWaypoint(index)->IsValid();
 }
 
-static inline void DeleteWaypoint(Waypoint *wp)
-{
-	wp->~Waypoint();
-}
-
 #define FOR_ALL_WAYPOINTS_FROM(wp, start) for (wp = GetWaypoint(start); wp != NULL; wp = (wp->index + 1U < GetWaypointPoolSize()) ? GetWaypoint(wp->index + 1U) : NULL) if (wp->IsValid())
 #define FOR_ALL_WAYPOINTS(wp) FOR_ALL_WAYPOINTS_FROM(wp, 0)