TASEmulators / BizHawk

BizHawk is a multi-system emulator written in C#. BizHawk provides nice features for casual gamers such as full screen, and joypad support in addition to full rerecording and debugging tools for all system cores.
http://tasvideos.org/BizHawk.html
Other
2.2k stars 385 forks source link

ToolManager always restarts tools on load #3948

Closed Morilli closed 5 months ago

Morilli commented 5 months ago

In ToolManager.Load, any tool that is created is first Restarted and then Shown: https://github.com/TASEmulators/BizHawk/blob/2c6129fb683e94daf1098502a93ce66ca0932c3b/src/BizHawk.Client.EmuHawk/tools/ToolManager.cs#L148-L150

The code looks to be very old, so I'm wondering if this is still sensible today. One potential issue caused by this can be seen in #3724 where the additional Restart call was not expected by the tool and caused double initialization.

In general I would expect a Restart method to be called whenever the tool needs to be restarted, and not on its initial load. It's possible external tools now depend on this restart method being called, but I'd still like to consider removing this call as I don't believe it makes sense as is.

YoshiRulz commented 5 months ago

This is intended. Tools (bundled or external) can't always finish initialisation during the constructor, as they may require some service but services don't get populated until after the ctor returns.