Fix crash on quit / pause not working.
Merge pull request #754 from unknownbrackets/quit-fix

Fix crash on quit / pause not working