Close the model object wrapper to avoid memory leak.