1
0
Fork 0
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:
Bertrand Songis 2016-03-01 19:59:32 +01:00
parent 2f9ae3750d
commit 23e597fffe

View file

@ -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;
}
}
}
}