However well you try to do things when it comes to coding sometimes you miss something and it leads to problems happening. For me today it was a hung Winamp instance on start-up that in the end was due to an issue in how the WACUP loader interacts with the original Winamp process.
The loader attempts to improve the responsiveness of how Winamp deals with existing Winamp instances that are already open which in most cases just hands off the action to the existing Winamp instance almost instantly so that there is only one Winamp instance.
In some cases (e.g. closing and re-opening Winamp within a few seconds of each other) Winamp can end up waiting until it either sees the other instance has closed or it’ll just timeout on checking and then start a new instance (which in the past has had issues and could lead to multiple unexpected Winamp instances running).
Unfortunately in implementing the patch to improve things (effectively doing more checks instead of a single generic one) I’d missed a scenario that only showed up randomly (due to timing issues with the closing and re-starting Winamp) and so I ended up causing Winamp to indefinitely hang on start-up for me.
Thankfully this time that it happened I was able to use the debugger to figure out what was going on and as with all of the best fixes it was one line of code. As a result of this I’ve now added the following message which appears once the checking is done and a hung Winamp instance appears to be present.
I’m hoping that this message will never be seen in actual usage but it’s there just in-case it does happen and provides some means to know that something is wrong (as Winamp natively can do this anyway if Winamp partially crashes) and what can be attempted to try to resolve the issue.