I had this problem and in my case was the battery problem. See, the battery sometimes sends wrong info to the system. In my case it was indicating that I had about 40% battery. I used the camera with flash and it immediately turned off. Happened several times. But after the last restart...