mirror of
https://github.com/opentx/opentx.git
synced 2025-07-25 01:05:10 +03:00
[Horus] Memory leak
This commit is contained in:
parent
2f9ae3750d
commit
23e597fffe
1 changed files with 4 additions and 0 deletions
|
@ -96,12 +96,16 @@ class WidgetsContainer: public WidgetsContainerInterface
|
|||
if (widgets) {
|
||||
unsigned int count = getZonesCount();
|
||||
for (unsigned int i=0; i<count; i++) {
|
||||
delete widgets[i];
|
||||
if (persistentData->zones[i].widgetName[0]) {
|
||||
char name[sizeof(persistentData->zones[i].widgetName)+1];
|
||||
memset(name, 0, sizeof(name));
|
||||
strncpy(name, persistentData->zones[i].widgetName, sizeof(persistentData->zones[i].widgetName));
|
||||
widgets[i] = loadWidget(name, getZone(i), &persistentData->zones[i].widgetData);
|
||||
}
|
||||
else {
|
||||
widgets[i] = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue