View Single Post
05/16/14, 03:45 PM   #3
Sharlikran
 
Sharlikran's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 660
Originally Posted by Sasky View Post
LibStub doesn't do a delayed load (which could cause other issues). It doesn't know what the later addons will have when it initializes the library, so it goes with the current highest. That means if the newer version comes later in the load order, it will be loaded as well.

Example, you have AddonA with 1.17, AddonB with 1.14, and AddonC with 1.19

If it goes through AddonA, AddonB, AddonC for load order:
AddonA - first addon, loads 1.17 of the lib.
AddonB - already loaded 1.17 which is newer than 1.14. Do nothing
AddonC - 1.19 is newer, load version 1.19 of the lib

In order for LibStub to behave as you described, it would have to wait until all the addons are loaded before it initializes the libraries. Of course, this means the Addon init functions would have to be pushed back as well.

What are you running into with loading the library twice?
I have been testing why there are no map and compass pins when multiple mods use the same version of the library.

However, as we speak it's working fine. I am totally confused as to why though because at least two people reported in the past they could not see pins. The fix was that all the versions had to have the same library. I had it happen to me this morning and I started looking for a reason. I kept backups of everything. Now no matter which backup I restore, everything works fine. I see map and compass pins. I'm totally confused now. Since it's working I'll just move on unless it quits working again in the future.
  Reply With Quote