• Thomas Haller's avatar
    c-e: don't transfer ownership of connection argument for callback functions · bd8108c3
    Thomas Haller authored
    Transfering ownership through multiple layers of function calls is
    complicated, because every layer must ensure that it either unrefs
    the connection or passes it to another function that takes ownership.
    Just don't do that. Whoever wants to keep a reference on the connection,
    should take it.
    Also, note that the destination of the connection is eventually
    nm_connection_editor_new(). But nm_connection_editor_new() doesn't take
    over the reference, it keeps the connection by taking an additional
    reference. I think we just leaked the connection there.
    Also, make the connection argument optional where it is not needed.
    That is necessary, because note how vpn_connection_new() behaves
    differently whether we pass in a connection or not.
ce-page.h 8.35 KB