Revert "replace use of gdk_pixmap_unref() with g_object_unref"

This reverts commit fdf0db02a0.

Even though `gdk_pixmap_unref` is deprecated, it is the correct way
to free `gdk_pixmap_new` objects.
This fixes a memory leak and glib warning:
GLib-GObject-CRITICAL **: g_object_unref: assertion 'G_IS_OBJECT (object)' failed

PS. Eventually this pixmap should be replaced by a cairo surface.
This commit is contained in:
Robin Gareus 2020-04-05 00:59:54 +02:00
parent e52bdc55ad
commit 419af82645
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
1 changed files with 2 additions and 2 deletions

View File

@ -43,7 +43,7 @@ PortMatrixComponent::PortMatrixComponent (PortMatrix* m, PortMatrixBody* b)
PortMatrixComponent::~PortMatrixComponent ()
{
if (_pixmap) {
g_object_unref (_pixmap);
gdk_pixmap_unref (_pixmap);
}
}
@ -76,7 +76,7 @@ PortMatrixComponent::get_pixmap (GdkDrawable *drawable)
/* make a pixmap of the right size */
if (_pixmap) {
g_object_unref (_pixmap);
gdk_pixmap_unref (_pixmap);
}
_pixmap = gdk_pixmap_new (drawable, _width, _height, -1);