Skip to content

Commit

Permalink
Merge pull request MoSync#396 from andersmalm/ThreeTwoOne
Browse files Browse the repository at this point in the history
Fix for MOSYNC-2926. iOS memory leak in maWidgetSetProperty
  • Loading branch information
milesm committed Mar 7, 2013
2 parents 4cdc079 + 6403e74 commit c431e67
Showing 1 changed file with 12 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -382,25 +382,29 @@ int maWidgetSetProperty(MAWidgetHandle handle, const char *property, const char*
IWidget* widget = [mosyncUI getWidget:handle];
if(widget == NULL) return MAW_RES_INVALID_HANDLE;

if(property == NULL)
return MAW_RES_INVALID_PROPERTY_NAME;

if(value == NULL)
return MAW_RES_INVALID_PROPERTY_VALUE;

NSString* propertyString = stringFromChar(property);

if([widget class] == [GLViewWidget class] || [widget class] == [GL2ViewWidget class] ) {
// do this from the MoSync thread. Maybe do a generic system for this later.
if([propertyString isEqualToString:@"bind"]) {
if([propertyString isEqualToString:@"bind"])
{
[propertyString release];
return [widget setPropertyWithKey:@"bind" toValue:@""];
}

if([propertyString isEqualToString:@"invalidate"]) {
if([propertyString isEqualToString:@"invalidate"])
{
[propertyString release];
return [widget setPropertyWithKey:@"invalidate" toValue:@""];
}
}

if(property == NULL)
return MAW_RES_INVALID_PROPERTY_NAME;

if(value == NULL)
return MAW_RES_INVALID_PROPERTY_VALUE;

int returnValue;

NSString *valueString = stringFromChar(value);
Expand Down

0 comments on commit c431e67

Please sign in to comment.