Mir

Code review comment for lp:~andreas-pokorny/mir/move-config-changer-to-input-thread

Revision history for this message
Alexandros Frantzis (afrantzis) wrote :

> 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.

« Back to merge proposal