mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2025-02-20 10:53:19 +00:00
Reduce memory usage during preview image loading
This commit is contained in:
parent
65fdafafd8
commit
c95e5af46d
1 changed files with 9 additions and 1 deletions
|
@ -228,9 +228,17 @@ namespace CodeImp.DoomBuilder.Data
|
|||
ConvertImageFormat(loadResult);
|
||||
MakeImagePreview(loadResult);
|
||||
|
||||
// Save memory by disposing the original image immediately if we only used it to load a preview image
|
||||
bool onlyPreview = false;
|
||||
if (imagestate == ImageLoadState.Ready)
|
||||
{
|
||||
loadResult.bitmap?.Dispose();
|
||||
onlyPreview = true;
|
||||
}
|
||||
|
||||
General.MainWindow.RunOnUIThread(() =>
|
||||
{
|
||||
if (imagestate != ImageLoadState.Ready)
|
||||
if (imagestate != ImageLoadState.Ready && !onlyPreview)
|
||||
{
|
||||
// Log errors and warnings
|
||||
foreach (LogMessage message in loadResult.messages)
|
||||
|
|
Loading…
Reference in a new issue