I think it's better for your own sanity just to accept that developing your app will mean your PC gets messy, and needs to be rebooted more frequently than usual.
If you start deleting stuff when your done with it, then you have to remember to delete anything you add. I think if you are going to add any tidy-up stuff like that, then make it as dynamic as possible - like step through everything and delete it. I might draw the line at un-dimming arrays, as that can get really fiddly. You can always optimize the shut down later for arrays.
I usually just reboot and have a coffee, sanity preserved
- the worst thing is wasting time looking for a bug that is nothing to do with your code and everything to do with the PC. I often get an error with OpenGL after I've compiled a dozen or so times... a bloke could spend a few fruitless hours trying to figure that out.
I am the one who knocks...