• Thomas Haller's avatar
    libnm: don't clear secrets during NMSimpleConnection:dispose() · 25aa6c05
    Thomas Haller authored
    NMConnection is an interface, implemented by NMSimpleConnection
    and NMRemoteConnection. A connection is basically a set of NMSetting
    Usually you would expect that one NMSetting instance only gets added to
    zero or one NMConnection. It seems a bit ugly, to have one setting tracked by
    multiple NMConnection. Still, technically I am not aware of a single problem
    with doing that, where it not for NMSimpleConnection:dispose() to clear the
    There is no need to clear the secrets of an NMSetting, when the
    NMConnection gets destroyed. Either this destroys the NMSetting instance
    right away (and NMSetting's destructor will clear the secrets anyway), or
    somebody else (e.g. another NMConnection instance), keeps the setting
    alive. In the latter case, it is wrong to clear the secrets at
    this point.
    This was done since commit 6a19e68a ('libnm-core: clear secrets from
    NMSimpleConnection and NMSettingsConnection dispose()'), but let's stop
    doing that.
    This also causes problems in practice, see [1].
    [1] https://gitlab.gnome.org/GNOME/gnome-control-center/-/merge_requests/1099#note_1334333