mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-05 09:10:29 +00:00
MACVENTURE: Fix leak on loadControls
This commit is contained in:
parent
2f2d9bead7
commit
28698ba697
@ -69,7 +69,7 @@ struct ControlData {
|
|||||||
ControlAction refcon;
|
ControlAction refcon;
|
||||||
ControlType type;
|
ControlType type;
|
||||||
uint8 titleLength;
|
uint8 titleLength;
|
||||||
char* title;
|
Common::String title;
|
||||||
uint16 border;
|
uint16 border;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -512,9 +512,11 @@ bool Gui::loadControls() {
|
|||||||
data.type = (ControlType)id; id++;
|
data.type = (ControlType)id; id++;
|
||||||
data.titleLength = res->readByte();
|
data.titleLength = res->readByte();
|
||||||
if (data.titleLength) {
|
if (data.titleLength) {
|
||||||
data.title = new char[data.titleLength + 1];
|
char *title = new char[data.titleLength + 1];
|
||||||
res->read(data.title, data.titleLength);
|
res->read(title, data.titleLength);
|
||||||
data.title[data.titleLength] = '\0';
|
title[data.titleLength] = '\0';
|
||||||
|
data.title = Common::String(title);
|
||||||
|
delete[] title;
|
||||||
}
|
}
|
||||||
if (data.type != kControlExitBox) {
|
if (data.type != kControlExitBox) {
|
||||||
BorderBounds bbs = borderBounds(getWindowData(kCommandsWindow).type);
|
BorderBounds bbs = borderBounds(getWindowData(kCommandsWindow).type);
|
||||||
|
Loading…
Reference in New Issue
Block a user