summaryrefslogtreecommitdiff
path: root/src/company_cmd.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-09-08 12:27:27 +0000
committerrubidium <rubidium@openttd.org>2009-09-08 12:27:27 +0000
commit472ed0dc76894928570e8a04d79c7d22b5fdca15 (patch)
treebbe73d07fa4cfe6db2ebfb949a68d44db87a554a /src/company_cmd.cpp
parent535f71fc13ced5ed1f68886fcd5aebb47d35f53c (diff)
downloadopenttd-472ed0dc76894928570e8a04d79c7d22b5fdca15.tar.xz
(svn r17473) -Codechange: use the post destructor for destroying companies too instead of complicating the graph GUI invalidate code.
Diffstat (limited to 'src/company_cmd.cpp')
-rw-r--r--src/company_cmd.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/company_cmd.cpp b/src/company_cmd.cpp
index e85caca4c..e80599b62 100644
--- a/src/company_cmd.cpp
+++ b/src/company_cmd.cpp
@@ -69,8 +69,16 @@ Company::~Company()
if (CleaningPool()) return;
DeleteCompanyWindows(this->index);
- InvalidateWindowData(WC_GRAPH_LEGEND, 0, this->index);
- InvalidateWindowData(WC_PERFORMANCE_DETAIL, 0, this->index);
+}
+
+/**
+ * Invalidating some stuff after removing item from the pool.
+ * @param index index of deleted item
+ */
+void Company::PostDestructor(size_t index)
+{
+ InvalidateWindowData(WC_GRAPH_LEGEND, 0, index);
+ InvalidateWindowData(WC_PERFORMANCE_DETAIL, 0, index);
}
/**