Sounds like the torpedoes were armed, but not yet fired. So the sub itself turning around in a circle triggered the self-destruct mechanism while the weapons were still in the tubes.
I think the implication is that the torpedos had not yet left their tubes, so when the sub turned around with them still in it they registered that as a situation where they should destruct.