(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.
authorrubidium
Mon, 06 Aug 2007 14:08:25 +0000
changeset 7916 8bc57ab02de6
parent 7915 8b20c0c2debf
child 7917 6a6eb0dec86a
(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.
src/industry_cmd.cpp
src/station.cpp
--- a/src/industry_cmd.cpp	Mon Aug 06 13:44:50 2007 +0000
+++ b/src/industry_cmd.cpp	Mon Aug 06 14:08:25 2007 +0000
@@ -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	Mon Aug 06 13:44:50 2007 +0000
+++ b/src/station.cpp	Mon Aug 06 14:08:25 2007 +0000
@@ -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;