Error when using Gtk.IconTheme

When I load an icon into a pixbuf with Gtk.IconTheme, it sporadically crashes my app with this message:

**
Gtk:ERROR:../../../../gtk/gtkicontheme.c:4047:proxy_pixbuf_destroy: assertion failed: (icon_info->proxy_pixbuf != NULL)
Bail out! Gtk:ERROR:../../../../gtk/gtkicontheme.c:4047:proxy_pixbuf_destroy: assertion failed: (icon_info->proxy_pixbuf != NULL)
Aborted (core dumped)

Example code:

import gi

gi.require_version('Gio', '2.0')
gi.require_version('Gtk', '3.0')

from gi.repository import Gio, Gtk

def get_gicon_pixbuf(icon):
    if icon:
        icon_info = Gtk.IconTheme.get_default().lookup_by_gicon_for_scale(icon, 512, 1, Gtk.IconLookupFlags.USE_BUILTIN)

        if icon_info:
            return icon_info.load_icon()

get_gicon_pixbuf(Gio.ThemedIcon.new_from_names(["dialog-error-symbolic"]))

It works fine for me.
Sometimes gi libraries give me warnings and critical errors, but they are at random occurrences and on re-running the same code, the messages vanish.

May be, if the issue persists, you can give us more info about your system that can reproduce the error. :slight_smile: