I just broke down the code to its absolute minimum. Even if I have an event loop this message occurs. If I quit my application while only one sprite is being used, the application returns the value 0x0, everything fine. If I use more than one sprite, it returns 0xC0000005 on closure.