On Thu, Sep 7, 2017 at 9:18 PM, Alan Griffiths <email address hidden> wrote: > +#include "mir/default_server_configuration.h" > +#include "wayland_connector.h" > + > +#include "../../scene/mediating_display_changer.h" > > #include "mir/frontend/display_changer.h" > > +#include "mir/graphics/platform.h" > + > +namespace mf = mir::frontend; > + > +std::shared_ptr<mf::Connector> > + mir::DefaultServerConfiguration::the_wayland_connector() > +{ > + return wayland_connector( > + [this]() -> std::shared_ptr<mf::Connector> > + { > + return std::make_shared<mf::WaylandConnector>( > + the_frontend_shell(), > + *the_mediating_display_changer(), > > *the_frontend_display_changer(), > > (Do we really want to avoid sharing ownership? Where's the lifetime > guarantee?)
The lifetime guarantee is that WaylandConnector does not store any reference to the mf::DisplayChanger; it's purely used at initialisation time.
« Back to merge proposal
On Thu, Sep 7, 2017 at 9:18 PM, Alan Griffiths <email address hidden> server_ configuration. h" connector. h" scene/mediating _display_ changer. h" display_ changer. h" platform. h" ptr<mf: :Connector> verConfiguratio n::the_ wayland_ connector( ) ptr<mf: :Connector> shared< mf::WaylandConn ector>( shell() , display_ changer( ), display_ changer( ),
wrote:
> +#include "mir/default_
> +#include "wayland_
> +
> +#include "../../
>
> #include "mir/frontend/
>
> +#include "mir/graphics/
> +
> +namespace mf = mir::frontend;
> +
> +std::shared_
> + mir::DefaultSer
> +{
> + return wayland_connector(
> + [this]() -> std::shared_
> + {
> + return std::make_
> + the_frontend_
> + *the_mediating_
>
> *the_frontend_
>
> (Do we really want to avoid sharing ownership? Where's the lifetime
> guarantee?)
The lifetime guarantee is that WaylandConnector does not store any
reference to the mf::DisplayChanger; it's purely used at initialisation
time.