mirror of
https://github.com/minetest/minetestmapper.git
synced 2024-11-22 07:23:46 +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.
23 lines
442 B
C++
23 lines
442 B
C++
#ifndef DB_REDIS_HEADER
|
|
#define DB_REDIS_HEADER
|
|
|
|
#include "db.h"
|
|
#include <hiredis.h>
|
|
|
|
class DBRedis : public DB {
|
|
public:
|
|
DBRedis(const std::string &mapdir);
|
|
virtual std::vector<BlockPos> getBlockPos();
|
|
virtual void getBlocksOnZ(std::map<int16_t, BlockList> &blocks, int16_t zPos);
|
|
virtual ~DBRedis();
|
|
private:
|
|
void loadPosCache();
|
|
|
|
std::vector<BlockPos> posCache;
|
|
|
|
redisContext *ctx;
|
|
std::string hash;
|
|
};
|
|
|
|
#endif // DB_REDIS_HEADER
|