Remove the unused resources.