mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
Image related leaks fix
This commit is contained in:
parent
6c70bb531b
commit
cbafb9a68b
2 changed files with 9 additions and 7 deletions
|
|
@ -326,12 +326,12 @@ ImageData* png::load_image(std::string filename) {
|
|||
}
|
||||
|
||||
Texture* png::load_texture(std::string filename) {
|
||||
ImageData* image = _png_load(filename.c_str());
|
||||
unique_ptr<ImageData> image (_png_load(filename.c_str()));
|
||||
if (image == nullptr){
|
||||
std::cerr << "Could not load image " << filename << std::endl;
|
||||
return nullptr;
|
||||
}
|
||||
return Texture::from(image);
|
||||
return Texture::from(image.get());
|
||||
}
|
||||
|
||||
void png::write_image(std::string filename, const ImageData* image) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue