Another unique pointer, for dialogue window.

This commit is contained in:
2025-02-28 21:58:44 -05:00
parent ee54d2aff8
commit 3a474cb68e

View File

@ -16,6 +16,8 @@
#include <math.h> // for rint()
#include <string.h>
#include <memory>
#include <FL/fl_ask.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_File_Chooser.H>
@ -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;
}