1
0
Fork 0
mirror of https://gitlab.gnome.org/GNOME/calls.git synced 2024-12-14 00:17:35 +00:00

new-call-box: Fix memory leak

calls_new_call_box_dial was taking a reference it never released.
This commit is contained in:
Evangelos Ribeiro Tzaras 2022-05-20 10:16:09 +02:00
parent 581c82fcd7
commit ee64b33e24

View file

@ -74,7 +74,7 @@ get_selected_origin (CallsNewCallBox *self)
if (model && index >= 0) if (model && index >= 0)
origin = g_list_model_get_item (model, index); origin = g_list_model_get_item (model, index);
return origin; return g_steal_pointer (&origin);
} }
@ -97,8 +97,8 @@ get_origin (CallsNewCallBox *self,
return NULL; return NULL;
origin = g_list_model_get_item (model, 0); origin = g_list_model_get_item (model, 0);
return origin;
return g_steal_pointer (&origin);
} else { } else {
return get_selected_origin (self); return get_selected_origin (self);
} }
@ -400,7 +400,7 @@ void
calls_new_call_box_dial (CallsNewCallBox *self, calls_new_call_box_dial (CallsNewCallBox *self,
const gchar *target) const gchar *target)
{ {
CallsOrigin *origin; g_autoptr (CallsOrigin) origin = NULL;
g_return_if_fail (CALLS_IS_NEW_CALL_BOX (self)); g_return_if_fail (CALLS_IS_NEW_CALL_BOX (self));
g_return_if_fail (target != NULL); g_return_if_fail (target != NULL);