-
Notifications
You must be signed in to change notification settings - Fork 451
Description
If an addon has an _addon.name field that differs from its filename, loading and unloading becomes confused.
The addon can be loaded by specifying the filename, but can only be unloaded through the lua name.
Repro:
make an addon with filename someaddon which contains the statement _addon.name = 'Some'
lua load some -> fail
lua load somename -> success
lua unload some -> success
lua unload somename -> fail
lua reload some -> success message followed by fail message
lua reload somename -> error message followed by success message
The last case is especially egregious because it results in the addon being loaded multiple times concurrently. Sequence of commands to reproduce:
lua load somename (success)
lua reload somename (fail -> success)
lua reload somename (fail -> success)
lua unload somename (success - as expected)
lua unload somename (success - expected error)
lua unload somename (success - expected error)
lua unload somename (error - as expected)
I have not tested if it's just a registration error or if multiple copies of the same addon are actually loaded at the same time - feels not very relevant as far as the need to fix.