Cleans up all previously allocated internal objects.
This method is called automatically when application is shutting down.