Skip to content

Load unload bug when _addon.name and filename differ. #2520

@lili-ffxi

Description

@lili-ffxi

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions