Fixed leak at WorldFiles::getLights

This commit is contained in:
MihailRis 2023-12-27 11:25:09 +03:00
parent 128bc277b8
commit 35b13adf03

View File

@ -207,10 +207,10 @@ ubyte* WorldFiles::getChunk(int x, int z){
}
light_t* WorldFiles::getLights(int x, int z) {
ubyte* data = getData(lights, getLightsFolder(), x, z, REGION_LAYER_LIGHTS);
std::unique_ptr<ubyte> data (getData(lights, getLightsFolder(), x, z, REGION_LAYER_LIGHTS));
if (data == nullptr)
return nullptr;
return Lightmap::decode(data);
return Lightmap::decode(data.get());
}
ubyte* WorldFiles::getData(regionsmap& regions, const fs::path& folder,