GoomiiV2 / Meldii

Melder V2
MIT License
11 stars 7 forks source link

Resolve an issue with git provider when multiple addons are using it. #30

Closed Xsear closed 8 years ago

Xsear commented 8 years ago

I set out to try and fix an issue where when there were multiple addons in the library that are using git repositories as their providers, Meldii appears to get confused and uses the wrong remote version numbers.

In these screenshots, the three highlighted addons use git repositories as their provider.

meldii-issue-1 On launch

meldii-issue-2 After clicking check for updates.

As can be seen, Meldii seems to retrieve the latest version number of one of the addons, and use it for all of the other ones.

I found that AddonManager's CheckForUpdates function starts operations on multiple threads in parallel, and that the GitRepository provider stores information about the addon it is currently operating on in a private member variable.

I surmised that due to multiple threads running at once and there seemingly only being one instance of the provider, the reference to the private variable is being overridden during execution, thus making it possible for the information of one addon to be used for another during the update procedure.

This commit is a fairly novice workaround to instead recreate the necessary information with each operation.

This then allows the information to be presented correctly.

meldii-issue-fixed After the proposed changes.

GoomiiV2 commented 8 years ago

Oh sorry didn't notice your PR untill now.