Skip to content

Commit

Permalink
Fixed leak at WorldFiles::getLights
Browse files Browse the repository at this point in the history
  • Loading branch information
MihailRis committed Dec 27, 2023
1 parent 128bc27 commit 35b13ad
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/files/WorldFiles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 35b13ad

Please sign in to comment.