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

ASF GitHub Bot commented on CB-11535:
-------------------------------------

GitHub user matrosovN opened a pull request:

    https://github.com/apache/cordova-ios/pull/238

    CB-11535 ios: fix bug with remove frameworks

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/matrosovN/cordova-ios master

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/cordova-ios/pull/238.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #238
    
----
commit a8c189b0ce55ea0c940ba9207b625cf4f7e76d36
Author: Nikita Matrosov <[email protected]>
Date:   2016-07-22T07:37:30Z

    CB-11535 ios: fix bug with remove frameworks

----


> 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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to