minetestmapper/db-leveldb.h
Nestorfish 26b62933ed TileGenerator: free database resources (#38)
Destructor of DB* instance was never called.
Ensure it is, adding missing base class virtual destructor and calling delete when possible to free resources.
2016-10-13 23:26:59 +02:00

22 lines
436 B
C++

#ifndef DB_LEVELDB_HEADER
#define DB_LEVELDB_HEADER
#include "db.h"
#include <leveldb/db.h>
class DBLevelDB : public DB {
public:
DBLevelDB(const std::string &mapdir);
virtual std::vector<BlockPos> getBlockPos();
virtual void getBlocksOnZ(std::map<int16_t, BlockList> &blocks, int16_t zPos);
virtual ~DBLevelDB();
private:
void loadPosCache();
std::vector<BlockPos> posCache;
leveldb::DB *db;
};
#endif // DB_LEVELDB_HEADER