From c861d9b64b2a63fa86ea87ac1e71f8f7341c694b Mon Sep 17 00:00:00 2001 From: smatz Date: Sun, 5 Jul 2009 13:20:05 +0000 Subject: (svn r16745) -Fix [FS#3011]: invalidate JoinStation window after removing item from the pool --- src/core/pool_func.hpp | 1 + src/core/pool_type.hpp | 9 +++++++++ 2 files changed, 10 insertions(+) (limited to 'src/core') diff --git a/src/core/pool_func.hpp b/src/core/pool_func.hpp index 3ac28f472..1687b4faf 100644 --- a/src/core/pool_func.hpp +++ b/src/core/pool_func.hpp @@ -108,6 +108,7 @@ DEFINE_POOL_METHOD(void)::FreeItem(size_t index) this->data[index] = NULL; this->first_free = min(this->first_free, index); this->items--; + if (!this->cleaning) Titem::PostDestructor(index); } DEFINE_POOL_METHOD(void)::CleanPool() diff --git a/src/core/pool_type.hpp b/src/core/pool_type.hpp index 2d32df724..2f35b4a88 100644 --- a/src/core/pool_type.hpp +++ b/src/core/pool_type.hpp @@ -221,6 +221,15 @@ struct Pool { { return Tpool->items; } + + /** + * Dummy function called after destructor of each member. + * If you want to use it, override it in PoolItem's subclass. + * @param index index of deleted item + * @note when this function is called, PoolItem::Get(index) == NULL. + * @note it's called only when !CleaningPool() + */ + static FORCEINLINE void PostDestructor(size_t index) { } }; private: -- cgit v1.2.3-54-g00ecf