Ok. It is true. The engine frees all its structs at closing time. But 'ptr_remove' does not remove the bitmaps pointed by its elements. Take a look at this:
If you don't delete the bitmap before 'ptr_remove', it remains in the graphics card, so it is not deleted. Forgive the tricky thing of accesing hypothetically released memory