std.signals uses the underlying function __dtor in the disconnectAll function to call the local destructor within a mixin.
Technically, this may be correct -- it only calls the mixin's dtor, it does not call any other destructors for the class, including base classes or derived classes.
However, this is a very BAD pattern to have inside phobos. Not only is it confusing, it gives the impression that __dtor is an acceptable way for normal destructor invocation.
The only thing that disconnectAll does besides call the destructor is set a couple of values. Instead of having disconnectAll do very little and call the destructor, just have the destructor call disconnectAll. The added overhead of reinitializing idx and status is inconsequential. And then it's less magic.
Comment #1 by robert.schadek — 2024-12-01T16:33:51Z