App: fix memory leaks in Enumeration class and simplify code
This commit is contained in:
@@ -232,14 +232,14 @@ void LinkBaseExtension::setProperty(int idx, Property *prop) {
|
||||
case PropLinkMode: {
|
||||
static const char *linkModeEnums[] = {"None","Auto Delete","Auto Link","Auto Unlink",nullptr};
|
||||
auto propLinkMode = static_cast<PropertyEnumeration*>(prop);
|
||||
if(!propLinkMode->getEnums())
|
||||
if(!propLinkMode->hasEnums())
|
||||
propLinkMode->setEnums(linkModeEnums);
|
||||
break;
|
||||
}
|
||||
case PropLinkCopyOnChange: {
|
||||
static const char *enums[] = {"Disabled","Enabled","Owned","Tracking",nullptr};
|
||||
auto propEnum = static_cast<PropertyEnumeration*>(prop);
|
||||
if(!propEnum->getEnums())
|
||||
if(!propEnum->hasEnums())
|
||||
propEnum->setEnums(enums);
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user