If the computer 'actually turned off', then your either tripping hitting the cut out temperature of your motherboard (to prevent the processor overheating and frying if your cooling fails, assuming your motherboard supports it), or the power supply is on it's way out. It's unlikely that something is loose as the Molex and other power connectors in a computer tend to be particularly awkward to dislodge.
