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
hehe yes,i know, because it s local created. Try panel.bmap = ent_create()...