mirror of
https://github.com/CloverHackyColor/CloverBootloader.git
synced 2024-12-28 17:08:18 +01:00
GetIcon memory leak.
This commit is contained in:
parent
5520ede381
commit
807e36c427
@ -319,19 +319,19 @@ const XImage& XTheme::GetIcon(INTN Id)
|
||||
return Icons[i].Image;
|
||||
}
|
||||
//if not found then create new one from embedded
|
||||
Icon* NewIcon = new Icon(Id, true);
|
||||
Icon NewIcon(Id, true);
|
||||
// NewIcon.GetEmbedded();
|
||||
// DBG("got embedded icon %lld name{%s}\n", Id, IconsNames[Id]);
|
||||
if (!Daylight && !NewIcon->ImageNight.isEmpty()) {
|
||||
if (!Daylight && !NewIcon.ImageNight.isEmpty()) {
|
||||
// DBG("got night icon and cache\n");
|
||||
Icons[i].ImageNight = NewIcon->ImageNight; //
|
||||
return NewIcon->ImageNight;
|
||||
Icons[i].ImageNight = NewIcon.ImageNight; //
|
||||
return Icons[i].ImageNight; // Do not return NewIcon.ImageNight, it'll freed
|
||||
}
|
||||
//if daylight or night icon absent
|
||||
if (!NewIcon->Image.isEmpty()) {
|
||||
if (!NewIcon.Image.isEmpty()) {
|
||||
// DBG("got day icon and cache\n");
|
||||
Icons[i].Image = NewIcon->Image;
|
||||
return NewIcon->Image;
|
||||
Icons[i].Image = NewIcon.Image;
|
||||
return Icons[i].Image;; // Do not return NewIcon.ImageNight, it'll freed
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user