summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--aircraft_gui.c4
-rw-r--r--roadveh_gui.c4
-rw-r--r--ship_gui.c4
-rw-r--r--train_gui.c4
4 files changed, 16 insertions, 0 deletions
diff --git a/aircraft_gui.c b/aircraft_gui.c
index 9ff7f6b46..41e9767a5 100644
--- a/aircraft_gui.c
+++ b/aircraft_gui.c
@@ -1067,6 +1067,10 @@ static void PlayerAircraftWndProc(Window *w, WindowEvent *e)
vl->resort_timer = DAY_TICKS * PERIODIC_RESORT_DAYS;
break;
+ case WE_DESTROY:
+ free(vl->sort_list);
+ break;
+
case WE_TICK: /* resort the list every 20 seconds orso (10 days) */
if (--vl->resort_timer == 0) {
DEBUG(misc, 1) ("Periodic resort aircraft list player %d station %d",
diff --git a/roadveh_gui.c b/roadveh_gui.c
index 2b81393cb..ed7f2201b 100644
--- a/roadveh_gui.c
+++ b/roadveh_gui.c
@@ -879,6 +879,10 @@ static void PlayerRoadVehWndProc(Window *w, WindowEvent *e)
vl->resort_timer = DAY_TICKS * PERIODIC_RESORT_DAYS;
break;
+ case WE_DESTROY:
+ free(vl->sort_list);
+ break;
+
case WE_TICK: /* resort the list every 20 seconds orso (10 days) */
if (--vl->resort_timer == 0) {
DEBUG(misc, 1) ("Periodic resort road vehicles list player %d station %d",
diff --git a/ship_gui.c b/ship_gui.c
index a8207787c..98e53f559 100644
--- a/ship_gui.c
+++ b/ship_gui.c
@@ -1047,6 +1047,10 @@ static void PlayerShipsWndProc(Window *w, WindowEvent *e)
vl->resort_timer = DAY_TICKS * PERIODIC_RESORT_DAYS;
break;
+ case WE_DESTROY:
+ free(vl->sort_list);
+ break;
+
case WE_TICK: /* resort the list every 20 seconds orso (10 days) */
if (--vl->resort_timer == 0) {
DEBUG(misc, 1) ("Periodic resort ships list player %d station %d",
diff --git a/train_gui.c b/train_gui.c
index adcb5a790..3e1de7bae 100644
--- a/train_gui.c
+++ b/train_gui.c
@@ -1351,6 +1351,10 @@ static void PlayerTrainsWndProc(Window *w, WindowEvent *e)
vl->resort_timer = DAY_TICKS * PERIODIC_RESORT_DAYS;
break;
+ case WE_DESTROY:
+ free(vl->sort_list);
+ break;
+
case WE_TICK: /* resort the list every 20 seconds orso (10 days) */
if (--vl->resort_timer == 0) {
DEBUG(misc, 1) ("Periodic resort trains list player %d station %d",