mirror of
https://github.com/minetest/minetestmapper.git
synced 2024-11-14 14:40:30 +01:00
26b62933ed
Destructor of DB* instance was never called. Ensure it is, adding missing base class virtual destructor and calling delete when possible to free resources.
22 lines
436 B
C++
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
|