I have made progress, but not yet found a definite solution. I've discovered that when this happens, if I turn off the computer (completely) and let it be turned off for 30 seconds, it's very unlikely it'll happen again. However, if I just restart it, it will most likely occur.
This made me question my ddr memory, wondering if it really was working properly. So I downloaded memtest 3.5, and, as it turns out, my computer will restart after a few seconds into the test (always at the same spot). Doesn't matter if I've had my computer turned off before or not. Also, once it has restarted in this manner, I won't be able to boot windows (it'll restart), until I have turned off the computer for 30 seconds. This really, really made me think my memories were broken. So I put one of my memories out, tested it in memtest 3.5. It worked fine. Switched slots. Worked fine. Tested the other one and did the same thing - everything working fine.
I also tested memtest 3.2, 3.4 and memtest+ 1.65, all working fine with both memories inserted. However, in memtest 3.5 (with both memories inserted), my computer will always restart, and keep restarting until I shut it down completely.
So I don't quite know what to make out of it. For now, I'm just sticking with shutting down my pc completely if this occurs. I haven't had this problem for a looong time. But every now and then, it might happen.