Windower / Issues

Windower Public Issue Tracker
31 stars 21 forks source link

Windower hanging on shutdown / returning to POL when addon uses packets API in 'unload' event. #1079

Open Imisnew2 opened 3 years ago

Imisnew2 commented 3 years ago

If an addon has registered an unload event, then Windower may hang when returning to POL (e.g. via hitting 'back' from the title screen) or when shutting down (e.g. via the /shutdown text command).

Here is a minimal addon reproducer.

_addon.name = 'Testing'
_addon.author = 'Imisnew'
_addon.commands = {'testing'}
_addon.version = '1.0.0.0'

windower.register_event('unload', function()
    -- Unsure if the packet type is relevant
    windower.packets.inject_incoming(0x052, string.char(0,0,0,0,0,0,0,0))
    windower.packets.inject_incoming(0x052, string.char(0,0,0,0,1,0,0,0))
end)

The steps to reproduce would be:

Some popular addons have code that injects packets on unload, which is how this was discovered.

Note: Other APIs, such as print(...) can also cause Windower to either hang or crash (with a C++ runtime error), but these were not observed to reliably cause Windower to hang or crash.