all repos — mgba @ 5a954d63db8d1c4936232081282488172d21b288

mGBA Game Boy Advance Emulator

Qt: Fix sprite/map export file handle leaks (fixs #1141)
Vicki Pfau vi@endrift.com
Mon, 23 Jul 2018 18:51:33 -0700
commit

5a954d63db8d1c4936232081282488172d21b288

parent

c04d627de8471939afd395c737181f52241df08d

2 files changed, 4 insertions(+), 0 deletions(-)

jump to
M src/platform/qt/MapView.cppsrc/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.cppsrc/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