mirror of https://github.com/mgba-emu/mgba.git
Qt: Fix sprite/map export file handle leaks (fixs #1141)
This commit is contained in:
parent
c04d627de8
commit
5a954d63db
|
@ -10,6 +10,7 @@
|
|||
#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 @@ void MapView::exportMap() {
|
|||
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
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#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 @@ void ObjView::exportObj() {
|
|||
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
|
||||
|
||||
|
|
Loading…
Reference in New Issue