I know this is an old post but.
Windows 10.
This is what worked for me !
I had the blue screen when I closed gearbox(every time). I found that if I made sure the pc sound setting was set to "speakers(realtek High Definition Audio(SST))"
By clicking the speaker icon ,bottom right and selecting it from the list.
My blue screen issue when closing gearbox was in the past .