Suggestion Closed - Already Exists

More event APIs are needed

#5295 opened by Unknown 2 years ago

Unknownreported this suggestion

We should send the dungeon preparation cleanup event before destroying the dungeon, which can remind other plugins that reference the world to stop and delete the reference to the dungeon world immediately to avoid memory leaks.

Unknowncommented

Have you used the DungeonEndEvent? This should fire before the DungeonDisposeEvent. For semantics purposes... the argument could be made to rename it from DungeonEndEvent to InstanceEndEvent... may do that.

Unknowncommented

Yes, I am using this event now, but the dungeon may be delayed for 30 seconds or 1 minute before cleaning up the entities and destroying the world instance (depending on the configuration "CleanupDelay: 600" in the dungeon). During the time waiting for the dungeon to be destroyed, some plugins may be dereferenced and reference the world again, causing the world to still exist in memory.

Unknowncommented

In fact we should add a "dungeon prepare cleanup event" so that we can almost immediately fix all memory leaks caused by third-party plugins referencing world and entity instances before the dungeon prepare cleanup

Unknowncommented

Sorry for my oversight, I solved the problem by using DungeonDisposeEvent, thanks for your reply

Sign in to join the discussion.