diff options
author | Einar Johan Trøan Sømåen | 2012-07-30 20:39:04 +0200 |
---|---|---|
committer | Einar Johan Trøan Sømåen | 2012-07-30 20:39:04 +0200 |
commit | 6330c1e5fdced523e1e245eac67754cd2b519c32 (patch) | |
tree | 9257bd4ef4b891759839f0082be2e9087ae00903 /engines/wintermute/base/gfx | |
parent | 18409fe5c03264ca74902e263f80523692f76a77 (diff) | |
download | scummvm-rg350-6330c1e5fdced523e1e245eac67754cd2b519c32.tar.gz scummvm-rg350-6330c1e5fdced523e1e245eac67754cd2b519c32.tar.bz2 scummvm-rg350-6330c1e5fdced523e1e245eac67754cd2b519c32.zip |
WINTERMUTE: Fix a few memory-leaks
Diffstat (limited to 'engines/wintermute/base/gfx')
-rw-r--r-- | engines/wintermute/base/gfx/osystem/base_surface_osystem.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/engines/wintermute/base/gfx/osystem/base_surface_osystem.cpp b/engines/wintermute/base/gfx/osystem/base_surface_osystem.cpp index c449f6471c..9f0e605f39 100644 --- a/engines/wintermute/base/gfx/osystem/base_surface_osystem.cpp +++ b/engines/wintermute/base/gfx/osystem/base_surface_osystem.cpp @@ -139,6 +139,7 @@ bool BaseSurfaceOSystem::finishLoad() { // convert 32-bit BMPs to 24-bit or they appear totally transparent (does any app actually write alpha in BMP properly?)
// Well, actually, we don't convert via 24-bit as the color-key application overwrites the Alpha-channel anyhow.
+ _surface->free();
delete _surface;
if (_filename.hasSuffix(".bmp") && image->getSurface()->format.bytesPerPixel == 4) {
_surface = image->getSurface()->convertTo(g_system->getScreenFormat(), image->getPalette());
@@ -412,6 +413,7 @@ bool BaseSurfaceOSystem::drawSprite(int x, int y, Rect32 *rect, float zoomX, flo bool BaseSurfaceOSystem::putSurface(const Graphics::Surface &surface, bool hasAlpha) {
_loaded = true;
+ _surface->free();
_surface->copyFrom(surface);
_hasAlpha = hasAlpha;
BaseRenderOSystem *renderer = static_cast<BaseRenderOSystem *>(_gameRef->_renderer);
|