From 4519469547c0f8befe74e3e80a94efb0e076ba34 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Tue, 22 Sep 2020 21:21:47 +0100 Subject: Do not call into things we don't own in destructors - Remove improper accesses in cChunk destructor * Fixes #4894 --- src/Chunk.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/Chunk.h') diff --git a/src/Chunk.h b/src/Chunk.h index 8aa73cde5..04f305f69 100644 --- a/src/Chunk.h +++ b/src/Chunk.h @@ -90,6 +90,11 @@ public: /** Returns true if the chunk could have been unloaded if it weren't dirty */ bool CanUnloadAfterSaving(void) const; + /** Called when the chunkmap unloads unused chunks. + Notifies contained entities that they are being unloaded and should for example, broadcast a destroy packet. + Not called during server shutdown; such cleanup during shutdown is unnecessary. */ + void OnUnload(); + bool IsLightValid(void) const {return m_IsLightValid; } /* -- cgit v1.2.3