tryashtar / image-map

Converts image to maps for Minecraft Java and Bedrock
247 stars 36 forks source link

Release bedrock world handle after each operation #48

Closed tryashtar closed 5 years ago

tryashtar commented 5 years ago

Currently, we open the leveldb when the user opens the world, and close it when the user opens a different world or when the program is closed.

This confuses everyone because they leave the program open and try to play bedrock and it either throws an error or fails to update some part of the world.

Let's change it so that every operation opens the leveldb, does the thing, then closes it. It should be relatively cheap. Most functions are already written to work in bulk (i.e. the loop is on the inside), so that's good.