Use g_clear_pointer on fields, which may get reused
This commit is contained in:
parent
e091dd4d15
commit
f410f57211
@ -124,7 +124,7 @@ static void on_get_capabilities(GDBusConnection *connection,
|
||||
g_variant_builder_add(builder, "s", "body-markup");
|
||||
|
||||
value = g_variant_new("(as)", builder);
|
||||
g_variant_builder_unref(builder);
|
||||
g_clear_pointer(&builder, g_variant_builder_unref);
|
||||
g_dbus_method_invocation_return_value(invocation, value);
|
||||
|
||||
g_dbus_connection_flush(connection, NULL, NULL, NULL);
|
||||
@ -615,8 +615,7 @@ int initdbus(void)
|
||||
|
||||
void dbus_tear_down(int owner_id)
|
||||
{
|
||||
if (introspection_data)
|
||||
g_dbus_node_info_unref(introspection_data);
|
||||
g_clear_pointer(&introspection_data, g_dbus_node_info_unref);
|
||||
|
||||
g_bus_unown_name(owner_id);
|
||||
}
|
||||
|
@ -176,7 +176,7 @@ int dunst_main(int argc, char *argv[])
|
||||
|
||||
run(NULL);
|
||||
g_main_loop_run(mainloop);
|
||||
g_main_loop_unref(mainloop);
|
||||
g_clear_pointer(&mainloop, g_main_loop_unref);
|
||||
|
||||
/* remove signal handler watches */
|
||||
g_source_remove(pause_src);
|
||||
|
Loading…
x
Reference in New Issue
Block a user