Skip to content
  • Thomas Haller's avatar
    libnm: workaround assertion failure for nmtst_connection_assert_unchanging()... · d704f021
    Thomas Haller authored
    libnm: workaround assertion failure for nmtst_connection_assert_unchanging() when disposing connection
    
    nmtst_connection_assert_unchanging() registers to the changed signals
    and asserts that they are not invoked. The purpose is that sometimes
    we want to keep a reference to an NMConnection and be sure that it does
    not get modified. This allows everybody to keep a reference to the very
    same connection instance without cloning it -- provided they too promise
    not to change it. This assert is to ensure that.
    
    Note that NMSimpleConnection.dispose() clears the secrets and thus upon
    destruction the assertion fails. At that point, the assertion is no longer
    relevant, because the purpose was to ensure that no alive instances gets
    modified. While destroying the instance, it's fine to modify it (nobody should
    have a reference to it anymore).
    
    This avoids the assertion failure when destroying a NMSimpleConnection with secrets
    that is set with nmtst_connection_assert_unchanging().
    d704f021