diff --git a/rtgui/cursormanager.cc b/rtgui/cursormanager.cc index 48bb19aed..9a28eb061 100644 --- a/rtgui/cursormanager.cc +++ b/rtgui/cursormanager.cc @@ -81,6 +81,29 @@ void CursorManager::init (Glib::RefPtr mainWindow) window = mainWindow; } +void CursorManager::cleanup() +{ + cAdd.reset(); + cAddPicker.reset(); + cCropDraw.reset(); + cCrosshair.reset(); + cHandClosed.reset(); + cHandOpen.reset(); + cEmpty.reset(); + cMoveBL.reset(); + cMoveBR.reset(); + cMoveL.reset(); + cMoveR.reset(); + cMoveTL.reset(); + cMoveTR.reset(); + cMoveX.reset(); + cMoveY.reset(); + cMoveXY.reset(); + cRotate.reset(); + cWB.reset(); + cWait.reset(); +} + /* Set the cursor of the given window */ void CursorManager::setCursor (Glib::RefPtr window, CursorShape shape) { diff --git a/rtgui/cursormanager.h b/rtgui/cursormanager.h index 7d3f068b2..111652726 100644 --- a/rtgui/cursormanager.h +++ b/rtgui/cursormanager.h @@ -82,6 +82,7 @@ private: public: void init (Glib::RefPtr mainWindow); + void cleanup (); static void setWidgetCursor (Glib::RefPtr window, CursorShape shape); static void setCursorOfMainWindow (Glib::RefPtr window, CursorShape shape); }; diff --git a/rtgui/filmsimulation.cc b/rtgui/filmsimulation.cc index f929048b8..9ea2a66fb 100644 --- a/rtgui/filmsimulation.cc +++ b/rtgui/filmsimulation.cc @@ -262,10 +262,17 @@ void ClutComboBox::setBatchMode(bool yes) } +void ClutComboBox::cleanup() +{ + cm.reset(); + cm2.reset(); +} + + void ClutComboBox::updateUnchangedEntry() { auto c = m_model()->children(); - + if (batchMode) { if (c.empty() || c[c.size()-1][m_columns().clutFilename] != "NULL") { Gtk::TreeModel::Row row = *(m_model()->append()); diff --git a/rtgui/filmsimulation.h b/rtgui/filmsimulation.h index 5f66b579e..c55662757 100644 --- a/rtgui/filmsimulation.h +++ b/rtgui/filmsimulation.h @@ -18,6 +18,8 @@ public: void setSelectedClut( Glib::ustring filename ); void setBatchMode(bool yes); + static void cleanup(); + private: void updateUnchangedEntry(); // in batchMode we need to add an extra entry "(Unchanged)". We do this whenever the widget is mapped (connecting to signal_map()), unless options.multiDisplayMode (see the comment below about cm2 in this case) diff --git a/rtgui/guiutils.cc b/rtgui/guiutils.cc index dfa747590..0eecdb7ff 100644 --- a/rtgui/guiutils.cc +++ b/rtgui/guiutils.cc @@ -581,6 +581,15 @@ void MyExpander::init() } } +void MyExpander::cleanup() +{ + inconsistentImage.reset(); + enabledImage.reset(); + disabledImage.reset(); + openedImage.reset(); + closedImage.reset(); +} + MyExpander::MyExpander(bool useEnabled, Gtk::Widget* titleWidget) : enabled(false), inconsistent(false), flushEvent(false), expBox(nullptr), child(nullptr), headerWidget(nullptr), statusImage(nullptr), diff --git a/rtgui/guiutils.h b/rtgui/guiutils.h index c3bec5d33..e4c38f347 100644 --- a/rtgui/guiutils.h +++ b/rtgui/guiutils.h @@ -231,6 +231,7 @@ public: /// Initialize the class by loading the images static void init(); + static void cleanup(); Glib::SignalProxy1< bool, GdkEventButton* > signal_button_release_event() { diff --git a/rtgui/rtwindow.cc b/rtgui/rtwindow.cc index a79209a36..1adc59420 100644 --- a/rtgui/rtwindow.cc +++ b/rtgui/rtwindow.cc @@ -857,6 +857,16 @@ bool RTWindow::on_delete_event (GdkEventAny* event) cacheMgr->closeCache (); // also makes cleanup if too large WhiteBalance::cleanup(); ProfilePanel::cleanup(); + ClutComboBox::cleanup(); + MyExpander::cleanup(); + mainWindowCursorManager.cleanup(); + editWindowCursorManager.cleanup(); + BatchQueueEntry::savedAsIcon.reset(); + FileBrowserEntry::editedIcon.reset(); + FileBrowserEntry::recentlySavedIcon.reset(); + FileBrowserEntry::enqueuedIcon.reset(); + FileBrowserEntry::hdr.reset(); + FileBrowserEntry::ps.reset(); if (!options.windowMaximized) { get_size (options.windowWidth, options.windowHeight);