Add and export the destroyAllResources function