diff --git a/dw/fltkui.cc b/dw/fltkui.cc index 2b987e5..f3fe245 100644 --- a/dw/fltkui.cc +++ b/dw/fltkui.cc @@ -777,9 +777,9 @@ void FltkComplexButtonResource::widgetCallback (Fl_Widget *widget, } } -dw::core::Platform *FltkComplexButtonResource::createPlatform () +std::unique_ptr< dw::core::Platform > FltkComplexButtonResource::createPlatform () { - return new FltkPlatform (); + return std::make_unique< FltkPlatform >(); } void FltkComplexButtonResource::attachView (FltkView *view) diff --git a/dw/fltkui.hh b/dw/fltkui.hh index df8613d..527d9ce 100644 --- a/dw/fltkui.hh +++ b/dw/fltkui.hh @@ -275,7 +275,7 @@ protected: void sizeAllocate (core::Allocation *allocation); - dw::core::Platform *createPlatform (); + std::unique_ptr< dw::core::Platform > createPlatform (); void setLayout (dw::core::Layout *layout); int reliefXThickness (); diff --git a/dw/ui.cc b/dw/ui.cc index 3364cc4..d28942d 100644 --- a/dw/ui.cc +++ b/dw/ui.cc @@ -345,7 +345,7 @@ void ComplexButtonResource::init (std::unique_ptr< Widget > widget) childWidget = widget.get(); /* FIXME: Buttons should not need a full Layout */ - layout = new Layout (createPlatform (), false); + layout = new Layout (createPlatform ().release(), false); setLayout (layout); DBG_OBJ_ASSOC_CHILD (layout); layout->setWidget (std::move( widget )); diff --git a/dw/ui.hh b/dw/ui.hh index 09856d8..14c7268 100644 --- a/dw/ui.hh +++ b/dw/ui.hh @@ -5,6 +5,8 @@ # error Do not include this file directly, use "core.hh" instead. #endif +#include + namespace dw { namespace core { @@ -427,7 +429,7 @@ protected: void setEmbed (Embed *embed); - virtual Platform *createPlatform () = 0; + virtual std::unique_ptr< Platform > createPlatform () = 0; virtual void setLayout (Layout *layout) = 0; virtual int reliefXThickness () = 0;