Skip to content

Commit b4bf74a

Browse files
EbonJaegerJoshStrobl
authored andcommitted
panel/plugin-manager: Don't free object owned by hashtable
When calling `g_hash_table_lookup`, the returned data is not owned by the caller. We should ref it so we don't have to worry about freeing vs not freeing later. Ref #766 Signed-off-by: Evan Maddock <[email protected]>
1 parent c1a2967 commit b4bf74a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/panel/plugin/plugin-manager.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,10 @@ BudgieAppletInfo *budgie_panel_plugin_manager_load_applet_instance(BudgiePanelPl
378378
}
379379

380380
plugin_name = g_settings_get_string(settings, BUDGIE_APPLET_KEY_NAME);
381-
info = g_hash_table_lookup(self->plugins, plugin_name);
381+
382+
if (g_hash_table_contains(self->plugins, plugin_name)) {
383+
info = g_object_ref(g_hash_table_lookup(self->plugins, plugin_name));
384+
}
382385

383386
// Check if the plugin has been loaded
384387
if (!PEAS_IS_PLUGIN_INFO(info)) {

0 commit comments

Comments
 (0)