Clean memory after exit