mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-16 22:58:09 +00:00
GRAPHICS: Fix leak in macgui border loading
This commit is contained in:
parent
2b6f1719e7
commit
9444a1864b
@ -324,19 +324,19 @@ void MacWindow::loadBorder(Common::SeekableReadStream &file, bool active, int lo
|
||||
source = *(bmpDecoder.getSurface());
|
||||
|
||||
source.convertToInPlace(surface->getSupportedPixelFormat(), bmpDecoder.getPalette());
|
||||
surface->create(source.w, source.h, source.format);
|
||||
surface->copyFrom(source);
|
||||
surface->applyColorKey(255, 0, 255, false);
|
||||
|
||||
if (active)
|
||||
_macBorder.addActiveBorder(*surface);
|
||||
_macBorder.addActiveBorder(surface);
|
||||
else
|
||||
_macBorder.addInactiveBorder(*surface);
|
||||
_macBorder.addInactiveBorder(surface);
|
||||
|
||||
if (!_macBorder.hasOffsets())
|
||||
_macBorder.setOffsets(lo, ro, to, bo);
|
||||
|
||||
updateInnerDims();
|
||||
source.free();
|
||||
}
|
||||
|
||||
void MacWindow::setCloseable(bool closeable) {
|
||||
|
@ -71,15 +71,15 @@ bool MacWindowBorder::hasBorder(bool active) {
|
||||
return active ? _activeInitialized : _inactiveInitialized;
|
||||
}
|
||||
|
||||
void MacWindowBorder::addActiveBorder(TransparentSurface &source) {
|
||||
void MacWindowBorder::addActiveBorder(TransparentSurface *source) {
|
||||
assert(!_activeBorder);
|
||||
_activeBorder = new NinePatchBitmap(&source, false);
|
||||
_activeBorder = new NinePatchBitmap(source, true);
|
||||
_activeInitialized = true;
|
||||
}
|
||||
|
||||
void MacWindowBorder::addInactiveBorder(TransparentSurface &source) {
|
||||
void MacWindowBorder::addInactiveBorder(TransparentSurface *source) {
|
||||
assert(!_inactiveBorder);
|
||||
_inactiveBorder = new NinePatchBitmap(&source, false);
|
||||
_inactiveBorder = new NinePatchBitmap(source, true);
|
||||
_inactiveInitialized = true;
|
||||
}
|
||||
|
||||
|
@ -86,14 +86,14 @@ public:
|
||||
* Will fail if there is already an active border.
|
||||
* @param The surface that will be displayed.
|
||||
*/
|
||||
void addActiveBorder(TransparentSurface &source);
|
||||
void addActiveBorder(TransparentSurface *source);
|
||||
|
||||
/**
|
||||
* Add the given surface as the display of the border in the inactive state.
|
||||
* Will fail if there is already an inactive border.
|
||||
* @param The surface that will be displayed.
|
||||
*/
|
||||
void addInactiveBorder(TransparentSurface &source);
|
||||
void addInactiveBorder(TransparentSurface *source);
|
||||
|
||||
/**
|
||||
* Accessor function for the custom offsets.
|
||||
|
Loading…
Reference in New Issue
Block a user