Qt: Fix sprite/map export file handle leaks (fixs #1141)
Vicki Pfau vi@endrift.com
Mon, 23 Jul 2018 18:51:33 -0700
2 files changed,
4 insertions(+),
0 deletions(-)
M
src/platform/qt/MapView.cpp
→
src/platform/qt/MapView.cpp
@@ -10,6 +10,7 @@ #include "GBAApp.h"
#include "LogController.h" #include <mgba-util/png-io.h> +#include <mgba-util/vfs.h> #ifdef M_CORE_GBA #include <mgba/internal/gba/memory.h> #endif@@ -184,5 +185,6 @@ mMapCache* mapCache = mMapCacheSetGetPointer(&m_cacheSet->maps, m_map);
QImage map = m_rawMap.rgbSwapped(); PNGWritePixelsA(png, map.width(), map.height(), map.bytesPerLine() / 4, static_cast<const void*>(map.constBits())); PNGWriteClose(png, info); + vf->close(vf); } #endif
M
src/platform/qt/ObjView.cpp
→
src/platform/qt/ObjView.cpp
@@ -22,6 +22,7 @@ #include <mgba/internal/gb/gb.h>
#include <mgba/internal/gb/io.h> #endif #include <mgba-util/png-io.h> +#include <mgba-util/vfs.h> using namespace QGBA;@@ -283,6 +284,7 @@ }
PNGWritePixels8(png, m_objInfo.width * 8, m_objInfo.height * 8, m_objInfo.width * 8, static_cast<void*>(buffer)); PNGWriteClose(png, info); delete[] buffer; + vf->close(vf); } #endif