Skip to content
Snippets Groups Projects
  • George Kiagiadakis's avatar
    ded2e34e
    global: properly destroy impl proxies that were removed by the server · ded2e34e
    George Kiagiadakis authored
    When a pw_global is removed on the server (by pw_registry_destroy() or other
    means), it triggers the proxy removed & the registry global_remove callbacks,
    but it does not necessarily destroy the pw_proxy.
    
    For client proxies, we were previously destroying them by unrefing the WpProxy
    in wp_global_rm_flags(), since the global was not "owned" by the WpProxy.
    
    For impl proxies, we were not doing anything, as we expected that it would
    only be removed from the registry if the local WpProxy was destroyed first.
    This is not always the case, though, as the server or another client may
    request to destroy this proxy with pw_registry_destroy()
    
    Now we always destroy the pw_proxy as soon as it is removed from the registry,
    no matter if it was a client or an impl proxy. If it was an impl proxy,
    the WpProxy will continue to live and it's up to the code that created it
    to handle the "pw-proxy-destroyed" signal and do something meaningful.
    If it was a client proxy, the global will still unref the WpProxy right after
    destroying the pw_proxy and there is no change in behavior.
    ded2e34e
    History
    global: properly destroy impl proxies that were removed by the server
    George Kiagiadakis authored
    When a pw_global is removed on the server (by pw_registry_destroy() or other
    means), it triggers the proxy removed & the registry global_remove callbacks,
    but it does not necessarily destroy the pw_proxy.
    
    For client proxies, we were previously destroying them by unrefing the WpProxy
    in wp_global_rm_flags(), since the global was not "owned" by the WpProxy.
    
    For impl proxies, we were not doing anything, as we expected that it would
    only be removed from the registry if the local WpProxy was destroyed first.
    This is not always the case, though, as the server or another client may
    request to destroy this proxy with pw_registry_destroy()
    
    Now we always destroy the pw_proxy as soon as it is removed from the registry,
    no matter if it was a client or an impl proxy. If it was an impl proxy,
    the WpProxy will continue to live and it's up to the code that created it
    to handle the "pw-proxy-destroyed" signal and do something meaningful.
    If it was a client proxy, the global will still unref the WpProxy right after
    destroying the pw_proxy and there is no change in behavior.