Mac restarts after locking screen
After I lock the screen or don't use the mac for a while it seems that it restarts. It goes to the gray screen with the apple logo and the loading bar, after that I can log in as normal. My macbook pro & my Mother in laws macbook pro both have this problem. Although, my macbook doesn't do this every time. I don't have this problem with my iMac and they are all on Yosemite. I
am curious to know if anyone else has had this problem and possible solutions? I do not have an apple store here but I do have an authorized seller.
Thanks in advance!
MacBook Pro (13-inch Mid 2012), OS X Yosemite (10.10.2)