I have a bunny who shoots bullets. To ensure that resources aren't being depleted, the game erases that bullet from a vector of bullets when the bullet comes off the screen (when its x value is less than zero). However, whenever the game erases the obsolete bullet, the game ends abruptly. I think this problem has something to do with when the sprite resources are freed. Can anyone please help...
Code: http://pastebin.com/wG6rRqa8
The key lines to acknowledge are lines 441 and the projectile class