Cleaner freeing of resources