mirror of
https://github.com/aseprite/aseprite.git
synced 2025-04-15 11:42:30 +00:00
Fix minor memory leak loading a doc::Palette from backup data
This commit is contained in:
parent
ea47f6624f
commit
f638b5ca2b
@ -1,5 +1,5 @@
|
||||
// Aseprite
|
||||
// Copyright (C) 2018-2020 Igara Studio S.A.
|
||||
// Copyright (C) 2018-2022 Igara Studio S.A.
|
||||
// Copyright (C) 2001-2018 David Capello
|
||||
//
|
||||
// This program is distributed under the terms of
|
||||
@ -308,9 +308,10 @@ private:
|
||||
return nullptr;
|
||||
|
||||
ObjectId palId = read32(s);
|
||||
Palette* pal = loadObject<Palette*>("pal", palId, &Reader::readPalette);
|
||||
std::unique_ptr<Palette> pal(
|
||||
loadObject<Palette*>("pal", palId, &Reader::readPalette));
|
||||
if (pal)
|
||||
spr->setPalette(pal, true);
|
||||
spr->setPalette(pal.get(), true);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user