diff --git a/rtgui/toolbar.cc b/rtgui/toolbar.cc index 6c44abe57..cf5148d8b 100644 --- a/rtgui/toolbar.cc +++ b/rtgui/toolbar.cc @@ -26,10 +26,8 @@ ToolBar::ToolBar () : showColPickers(true), listener (nullptr), pickerListener(n editingMode = false; - handimg = Gtk::manage (new RTImage ("openhand.png")); - handimg->reference(); - editinghandimg = Gtk::manage (new RTImage ("editmodehand.png")); - editinghandimg->reference(); + handimg.reset(new RTImage("openhand.png")); + editinghandimg.reset(new RTImage("editmodehand.png")); handTool = Gtk::manage (new Gtk::ToggleButton ()); handTool->add (*handimg); @@ -48,10 +46,8 @@ ToolBar::ToolBar () : showColPickers(true), listener (nullptr), pickerListener(n pack_start (*wbTool); - showcolpickersimg = Gtk::manage (new RTImage ("colorPickers-show.png")); - showcolpickersimg->reference(); - hidecolpickersimg = Gtk::manage (new RTImage ("colorPickers-hide.png")); - hidecolpickersimg->reference(); + showcolpickersimg.reset(new RTImage("colorPickers-show.png")); + hidecolpickersimg.reset(new RTImage("colorPickers-hide.png")); colPickerTool = Gtk::manage (new Gtk::ToggleButton ()); colPickerTool->add (*showcolpickersimg); @@ -97,14 +93,6 @@ ToolBar::ToolBar () : showColPickers(true), listener (nullptr), pickerListener(n straTool->set_tooltip_markup (M("TOOLBAR_TOOLTIP_STRAIGHTEN")); } -ToolBar::~ToolBar () -{ - handimg->unreference(); - editinghandimg->unreference(); - showcolpickersimg->unreference(); - hidecolpickersimg->unreference(); - -} // // Selects the desired tool without notifying the listener // diff --git a/rtgui/toolbar.h b/rtgui/toolbar.h index 93cefb555..42e764952 100644 --- a/rtgui/toolbar.h +++ b/rtgui/toolbar.h @@ -39,10 +39,10 @@ public: class ToolBar : public Gtk::HBox { private: - RTImage* handimg; - RTImage* editinghandimg; - RTImage* showcolpickersimg; - RTImage* hidecolpickersimg; + std::unique_ptr handimg; + std::unique_ptr editinghandimg; + std::unique_ptr showcolpickersimg; + std::unique_ptr hidecolpickersimg; bool showColPickers; void hand_pressed (); @@ -72,7 +72,6 @@ protected: public: ToolBar (); - ~ToolBar (); void setTool (ToolMode tool); ToolMode getTool ()