From 5d489d1441f1883145ffcde1e7de5b11010644690f5d31af812f40b7883a286e Mon Sep 17 00:00:00 2001 From: ADAM David Alan Martin Date: Fri, 28 Feb 2025 15:16:08 -0500 Subject: [PATCH] Move to another unique ptr. --- dpi/downloads.cc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/dpi/downloads.cc b/dpi/downloads.cc index 897cce8..290d5a7 100644 --- a/dpi/downloads.cc +++ b/dpi/downloads.cc @@ -31,6 +31,7 @@ #include #include +#include #include #include @@ -116,7 +117,7 @@ class DLItem { int WgetStatus; int gw, gh; - Fl_Group *group; + std::unique_ptr< Fl_Group > group; ProgressBar *prBar; Fl_Button *prButton; Fl_Widget *prTitle, *prGot, *prSize, *prRate, *pr_Rate, *prETA, *prETAt; @@ -135,7 +136,7 @@ public: void pid(pid_t p) { mPid = p; } void child_finished(int status); void status_msg(const char *msg) { prBar->message((char*)msg); } - Fl_Widget *get_widget() { return group; } + Fl_Widget *get_widget() { return group.get(); } int widget_done() { return WidgetDone; } void widget_done(int val) { WidgetDone = val; } int updates_done() { return UpdatesDone; } @@ -346,7 +347,7 @@ DLItem::DLItem(const char *full_filename, const char *url, const char *user_agen WgetStatus = -1; gw = 400, gh = 70; - group = new Fl_Group(0,0,gw,gh); + group = std::make_unique< Fl_Group >(0,0,gw,gh); group->begin(); prTitle = new Fl_Box(24, 7, 290, 23); prTitle->box(FL_RSHADOW_BOX); @@ -436,8 +437,6 @@ DLItem::~DLItem() free(log_text); dFree(esc_url); dFree(cookies_path); - - delete(group); } /*