Fix memory leak in Pixbuf copying

This commit is contained in:
Julian Ospald 2017-07-19 17:51:52 +02:00
parent a64923b818
commit 8cc453e6cd

View File

@ -17,7 +17,7 @@ use std::path::*;
pub fn copy_pixbuf(pixbuf: &gdk_pixbuf::Pixbuf) -> gdk_pixbuf::Pixbuf { pub fn copy_pixbuf(pixbuf: &gdk_pixbuf::Pixbuf) -> gdk_pixbuf::Pixbuf {
let new_pixbuf = unsafe { let new_pixbuf = unsafe {
let gdk_pixbuf = pixbuf.to_glib_full(); let gdk_pixbuf = pixbuf.to_glib_none().0;
let copy = gdk_pixbuf_sys::gdk_pixbuf_copy(gdk_pixbuf); let copy = gdk_pixbuf_sys::gdk_pixbuf_copy(gdk_pixbuf);
FromGlibPtrFull::from_glib_full(copy) FromGlibPtrFull::from_glib_full(copy)
}; };