GUI: Free up original images after loading thumbs

This commit is contained in:
av-dx 2021-06-23 18:07:40 +05:30 committed by Eugene Sandulenko
parent bf7c05b265
commit a643f12eab

View file

@ -264,6 +264,8 @@ GridWidget::GridWidget(GuiObject *boss, int x, int y, int w, int h)
if (surf) {
const Graphics::ManagedSurface *scSurf(scaleGfx(surf, _thumbnailWidth, 512));
_loadedSurfaces[String("placeholder")] = scSurf;
surf->free();
delete surf;
}
}
@ -292,6 +294,8 @@ GridWidget::GridWidget(GuiObject *boss, const String &name)
if (surf) {
const Graphics::ManagedSurface *scSurf(scaleGfx(surf, _thumbnailWidth, 512));
_loadedSurfaces[String("placeholder")] = scSurf;
surf->free();
delete surf;
}
}
@ -360,6 +364,8 @@ void GridWidget::reloadThumbnails() {
if (surf) {
const Graphics::ManagedSurface *scSurf(scaleGfx(surf, _thumbnailWidth, 512));
_loadedSurfaces[path] = scSurf;
surf->free();
delete surf;
}
}
}