Fixes #3908, Large memory leak when switching folder in file browser

This commit is contained in:
heckflosse
2017-06-24 22:40:41 +02:00
parent 159ddf2d7a
commit e4c75c4d38

View File

@@ -56,20 +56,12 @@ void ThumbBrowserEntryBase::updateBackBuffer ()
Gtk::Widget* w = parent->getDrawingArea ();
Glib::RefPtr<Gdk::Window> win = w->get_window();
if (!win)
// Nothing to draw on, so we return
{
return;
}
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) );
backBuffer = Glib::RefPtr<BackBuffer> ( new BackBuffer (exp_width, exp_height, Cairo::FORMAT_RGB24) );
}
// If thumbnail is hidden by a filter, drawing to it will crash