You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2016/08/02 06:28:20 UTC

[jira] [Commented] (CB-11535) Logic error in uninstall frameworks in iOS

    [ https://issues.apache.org/jira/browse/CB-11535?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15403453#comment-15403453 ] 

ASF subversion and git services commented on CB-11535:
------------------------------------------------------

Commit 26a997dbfc3185e12248eecb8889d599b47d9a99 in cordova-ios's branch refs/heads/master from [~Nikita Matrosov]
[ https://git-wip-us.apache.org/repos/asf?p=cordova-ios.git;h=26a997d ]

CB-11535 CB-10361 ios: fix bug with remove frameworks

This closes #238


> Logic error in uninstall frameworks in iOS
> ------------------------------------------
>
>                 Key: CB-11535
>                 URL: https://issues.apache.org/jira/browse/CB-11535
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: iOS
>            Reporter: Shazron Abdullah
>
> This is reference counting code.
> Line: https://github.com/apache/cordova-ios/blob/5c3885b807f4c9556bf350c72400827a333f78d3/bin/templates/scripts/cordova/lib/plugman/pluginHandlers.js#L100
> {code}
> project.frameworks[src] -= (project.frameworks[src] || 1) - 1;
> {code}
> which expands to:
> {code}
> project.frameworks[src] = project.frameworks[src] - (project.frameworks[src] || 1) - 1;
> {code}
> project.frameworks[src] would contain a number, or undefined.
> My guess is that the intent of this line is to decrement the reference count by 1. If the count was not set, the resulting count value should be negative, according to the next conditional "if (project.frameworks[src] < 1) {" where it would delete the entry in the object.
> The correct line should be:
> {code}
> project.frameworks[src] = (project.frameworks[src] || 1) - 1;
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org