Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-5225

World handle isn't closed if world is unloaded without saving

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • None
    • git-Spigot-1981d55-3e7b386
    • DungeonsXL (up to build 767)
    • Yes

      When you successfully unload a world without saving - Bukkit.unloadWorld(world, false) returns true - the world isn't recognized in the API anymore, but the files still cannot be deleted, so I believe the world is removed from the API, but kept in memory by the server itself.

      It seems to be because of this line, where the world handle is only closed if the world should be saved:

      https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/src/main/java/org/bukkit/craftbukkit/CraftServer.java#987

      I'm not sure if this is a bug, missing documentation or my misunderstanding, but intuitively, I think the world should be closed no matter if it is saved or not.

      My use-case is a world instantiation plugin where adventure map world folders in a set state are copied into the server's root directory, loaded, played, and after that deleted. Saving them right before deleting them would be a waste of time, but I can't delete them if I don't.

       

            Unassigned Unassigned
            Sataniel Daniel Saukel
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: