Explicitly destroy static Glib::RefPtr<>s on exit (fixes #3636)

This commit is contained in:
Flössie
2019-03-09 12:06:54 +01:00
parent 2d0b376ae9
commit 51f06dfa6d
7 changed files with 54 additions and 1 deletions

View File

@@ -81,6 +81,29 @@ void CursorManager::init (Glib::RefPtr<Gdk::Window> 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<Gdk::Window> window, CursorShape shape)
{

View File

@@ -82,6 +82,7 @@ private:
public:
void init (Glib::RefPtr<Gdk::Window> mainWindow);
void cleanup ();
static void setWidgetCursor (Glib::RefPtr<Gdk::Window> window, CursorShape shape);
static void setCursorOfMainWindow (Glib::RefPtr<Gdk::Window> window, CursorShape shape);
};

View File

@@ -262,6 +262,13 @@ void ClutComboBox::setBatchMode(bool yes)
}
void ClutComboBox::cleanup()
{
cm.reset();
cm2.reset();
}
void ClutComboBox::updateUnchangedEntry()
{
auto c = m_model()->children();

View File

@@ -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)

View File

@@ -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),

View File

@@ -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()
{

View File

@@ -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);