(svn r14304) -Fix (r14104): waypoint train list wasn't closed with the waypoint window (crashes since r14296)
authorsmatz
Fri, 12 Sep 2008 22:52:48 +0000
changeset 10120 f158a34ecdea
parent 10119 00bd6a85b068
child 10121 f29f9f818ce4
(svn r14304) -Fix (r14104): waypoint train list wasn't closed with the waypoint window (crashes since r14296)
src/waypoint_gui.cpp
--- a/src/waypoint_gui.cpp	Fri Sep 12 21:59:34 2008 +0000
+++ b/src/waypoint_gui.cpp	Fri Sep 12 22:52:48 2008 +0000
@@ -15,6 +15,7 @@
 #include "gfx_func.h"
 #include "command_func.h"
 #include "functions.h"
+#include "window_func.h"
 
 #include "table/strings.h"
 
@@ -45,6 +46,11 @@
 		this->FindWindowPlacementAndResize(desc);
 	}
 
+	~WaypointWindow()
+	{
+		DeleteWindowById(WC_TRAINS_LIST, (this->window_number << 16) | (VEH_TRAIN << 11) | VLW_WAYPOINT_LIST | this->wp->owner);
+	}
+
 	virtual void OnPaint()
 	{
 		/* You can only change your own waypoints */