From 3a474cb68e2dd06a84f7335838a3ac9acdebbcc7bc19f2d50d917ec2cde2ab27 Mon Sep 17 00:00:00 2001 From: ADAM David Alan Martin Date: Fri, 28 Feb 2025 21:58:44 -0500 Subject: [PATCH] Another unique pointer, for dialogue window. --- src/dialog.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/dialog.cc b/src/dialog.cc index a523e8c..6228f6e 100644 --- a/src/dialog.cc +++ b/src/dialog.cc @@ -16,6 +16,8 @@ #include // for rint() #include +#include + #include #include #include @@ -158,7 +160,7 @@ const char *a_Dialog_input(const char *title, const char *msg) if (!(title && *title)) title = "Flenser: Input"; - Fl_Window *window = new Fl_Window(ww,wh,title); + auto window = std::make_unique< Fl_Window >(ww,wh,title); window->set_modal(); window->begin(); Fl_Group* ib = new Fl_Group(0,0,window->w(),window->h()); @@ -222,7 +224,7 @@ const char *a_Dialog_input(const char *title, const char *msg) input_str = dStrdup(c_inp->value()); prefs.search_url_idx = ch->value(); } - delete window; + window.reset(); return (input_answer == 1) ? input_str : NULL; }