diff --git a/project/src/graphics/format/JPEG.cpp b/project/src/graphics/format/JPEG.cpp index 9253e45aae..2bb290d3b2 100644 --- a/project/src/graphics/format/JPEG.cpp +++ b/project/src/graphics/format/JPEG.cpp @@ -487,6 +487,8 @@ namespace lime { } + jpeg_destroy_compress (&cinfo); + return true; } diff --git a/project/src/graphics/format/PNG.cpp b/project/src/graphics/format/PNG.cpp index 1f3a3a0c06..78aeecde9b 100644 --- a/project/src/graphics/format/PNG.cpp +++ b/project/src/graphics/format/PNG.cpp @@ -237,6 +237,8 @@ namespace lime { if (!info_ptr) { + png_destroy_write_struct (&png_ptr, NULL); + return false; } @@ -310,6 +312,8 @@ namespace lime { } + png_destroy_write_struct (&png_ptr, &info_ptr); + return true; }