> Yes the actual input device hub is kept alive via loaded platform / input manager / DisplayServer
> and also via ipc factory / Connector / DisplayServer. I am using a weak_ptr to avoid a cycle
> between hub and observers.
Hmm, still... the fact that if one calls mir::DefaultServerConfiguration::the_input_device_hub() as the first or only input-related method, they will get a broken InputDeviceHub is super-unintuitive and makes me very uneasy.
Couldn't mi::ExternalInputDeviceHub hold a shared_ptr<> to the hub? It makes sense for a wrapper to hold a strong reference, not a weak one. The Internal/Observer class would continue to hold a weak_ptr (or even a raw pointer, if we can guarantee the related lifetimes) to break the cycle.
> Yes the actual input device hub is kept alive via loaded platform / input manager / DisplayServer
> and also via ipc factory / Connector / DisplayServer. I am using a weak_ptr to avoid a cycle
> between hub and observers.
Hmm, still... the fact that if one calls mir::DefaultSer verConfiguratio n::the_ input_device_ hub() as the first or only input-related method, they will get a broken InputDeviceHub is super-unintuitive and makes me very uneasy.
Couldn't mi::ExternalInp utDeviceHub hold a shared_ptr<> to the hub? It makes sense for a wrapper to hold a strong reference, not a weak one. The Internal/Observer class would continue to hold a weak_ptr (or even a raw pointer, if we can guarantee the related lifetimes) to break the cycle.