diff --git a/vips.go b/vips.go index e46b03f..25448b3 100644 --- a/vips.go +++ b/vips.go @@ -394,6 +394,7 @@ func vipsPreSave(image *C.VipsImage, o *vipsSaveOptions) (*C.VipsImage, error) { if int(err) != 0 { return nil, catchVipsError() } + C.g_object_unref(C.gpointer(image)) image = outImage }