Skip to content

displaystatetracker: Destroy proxy when name vanishes

When the `org.gnome.Mutter.DisplayConfig` name appears,
a proxy object is created for it. However, when the name
vanishes, the proxy is not removed.

Firstly, if the name then reappears and the proxy is recreated,
then the reference to the previous proxy is lost,
leading to a memory leak.

Secondly, it is possible that `sync_state()` runs and sends
a dbus call just before the name vanishes. In that case,
when `get_current_state_cb()` runs `traker->proxy` may not be
the proxy that was used to send the call leading to a

  g_dbus_proxy_call_finish_internal: assertion 'g_task_is_valid (res, proxy)' failed

warning and then a NULL pointer derference as `error` is left as a NULL pointer.

Closes #103 (closed)

Merge request reports