Issue 2990: Fix possible memory leak ; at least, let the Windows version

w/ Gtk3.18 start w/o crashing
This commit is contained in:
Hombre
2015-11-29 02:41:07 +01:00
parent cd8c04d548
commit 6d447f7e02

View File

@@ -64,7 +64,13 @@ void ThumbBrowserEntryBase::updateBackBuffer ()
return;
}
backBuffer = Glib::RefPtr<BackBuffer> ( new BackBuffer (exp_width, exp_height, win) );
if (backBuffer && (backBuffer->getWidth() != exp_width || backBuffer->getHeight() != exp_height )) {
// deleting the existing BackBuffer
backBuffer.reset();
}
if (!backBuffer) {
backBuffer = Glib::RefPtr<BackBuffer> ( new BackBuffer (exp_width, exp_height, win) );
}
// If thumbnail is hidden by a filter, drawing to it will crash
// if either with or height is zero then return early