changeset 7420:edb2c250e91c draft

(svn r10813) -Fix (r10799): some destructors were performing too much during the pool cleanups, which could cause crashes as already removed pool items could then be dereferenced by other destructors.
author rubidium <rubidium@openttd.org>
date Mon, 06 Aug 2007 14:08:25 +0000
parents 95e6e55cf9d8
children 79141b3cee29
files src/industry_cmd.cpp src/station.cpp
diffstat 2 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/industry_cmd.cpp
+++ b/src/industry_cmd.cpp
@@ -130,6 +130,8 @@
 
 Industry::~Industry()
 {
+	if (CleaningPool()) return;
+
 	/* Industry can also be destroyed when not fully initialized.
 	 * This means that we do not have to clear tiles either. */
 	if (this->width == 0) {
--- a/src/station.cpp
+++ b/src/station.cpp
@@ -391,6 +391,8 @@
   */
 RoadStop::~RoadStop()
 {
+	if (CleaningPool()) return;
+
 	/* Clear the slot assignment of all vehicles heading for this road stop */
 	if (num_vehicles != 0) {
 		Vehicle *v;