Skip to content
  • Georges Basile Stavracas Neto's avatar
    extension-set: Return proper ref to inner object · 83f815e6
    Georges Basile Stavracas Neto authored
    As of now, if one tries to use GListModel APIs on PeasExtensionSet,
    specifically g_list_model_get_item(), it'll generate a warning and
    potentially a crash due to NULL pointers.
    
    See, the 'extensions' field of PeasExtensionSet is a GQueue that
    holds ExtensionItem elements. ExtensionItems are not GObjects, but
    they do hold a reference to the instantiated extension which must
    be a GObject.
    
    The GListModel implementation of PeasExtensionSet tries to call
    g_object_ref() on an ExtensionItem pointer, which fails and returns
    NULL. The appropriate return value would be to call g_object_ref()
    on the 'exten' field of the ExtensionItem at that position.
    
    Do just that.
    83f815e6