mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-20 07:00:39 +01:00
wifi: delay release of old wfd_ies array in nm_wifi_p2p_peer_set_wfd_ies()
We should first ref the new instance and emit the notify signal, before unref the old value. It feels better in this order.
This commit is contained in:
parent
e33b200880
commit
0586e9700d
1 changed files with 2 additions and 1 deletions
|
|
@ -260,6 +260,7 @@ gboolean
|
|||
nm_wifi_p2p_peer_set_wfd_ies (NMWifiP2PPeer *peer, GBytes *wfd_ies)
|
||||
{
|
||||
NMWifiP2PPeerPrivate *priv;
|
||||
gs_unref_bytes GBytes *wfd_ies_old = NULL;
|
||||
|
||||
g_return_val_if_fail (NM_IS_WIFI_P2P_PEER (peer), FALSE);
|
||||
|
||||
|
|
@ -268,7 +269,7 @@ nm_wifi_p2p_peer_set_wfd_ies (NMWifiP2PPeer *peer, GBytes *wfd_ies)
|
|||
if (nm_gbytes_equal0 (priv->wfd_ies, wfd_ies))
|
||||
return FALSE;
|
||||
|
||||
g_bytes_unref (priv->wfd_ies);
|
||||
wfd_ies_old = g_steal_pointer (&priv->wfd_ies);
|
||||
priv->wfd_ies = wfd_ies ? g_bytes_ref (wfd_ies) : NULL;
|
||||
|
||||
_notify (peer, PROP_WFD_IES);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue