Use wx_ptr for AutoCropDialog
[dcpomatic.git] / src / wx / content_menu.cc
index ac7a2b58b44d13bf071e8d6055b8919b5d334f70..83b84f5947e41161a1cacdc86546ea0925309580 100644 (file)
@@ -545,11 +545,7 @@ ContentMenu::auto_crop ()
        auto const crop = guess_crop_for_content ();
        update_viewer (crop);
 
-       if (_auto_crop_dialog) {
-               _auto_crop_dialog->Destroy();
-               _auto_crop_dialog = nullptr;
-       }
-       _auto_crop_dialog = new AutoCropDialog (_parent, crop);
+       _auto_crop_dialog.reset(_parent, crop);
        _auto_crop_dialog->Show ();
 
        /* Update the dialog and view when the crop threshold changes */