On Tue, 19 May 2015 10:07:39 +0200 David FORT <rdp.eff...@gmail.com> wrote:
> This patch makes the seat dynamic and leak it on purpose during seat removal > to > prevent the ghost object case. > --- > src/compositor-rdp.c | 39 +++++++++++++++++++++++++++------------ > 1 file changed, 27 insertions(+), 12 deletions(-) > > diff --git a/src/compositor-rdp.c b/src/compositor-rdp.c > index 3185141..f1dcda0 100644 > --- a/src/compositor-rdp.c > +++ b/src/compositor-rdp.c > @@ -105,7 +105,7 @@ enum peer_item_flags { > struct rdp_peers_item { > int flags; > freerdp_peer *peer; > - struct weston_seat seat; > + struct weston_seat *seat; > > struct wl_list link; > }; > @@ -606,6 +606,7 @@ static void > rdp_peer_context_free(freerdp_peer* client, RdpPeerContext* context) > { > int i; > + struct weston_seat *seat; > if (!context) > return; > > @@ -616,9 +617,17 @@ rdp_peer_context_free(freerdp_peer* client, > RdpPeerContext* context) > } > > if (context->item.flags & RDP_PEER_ACTIVATED) { > - weston_seat_release_keyboard(&context->item.seat); > - weston_seat_release_pointer(&context->item.seat); > - weston_seat_release(&context->item.seat); > + seat = context->item.seat; > + weston_seat_release_keyboard(seat); > + weston_seat_release_pointer(seat); > + > + /* picked from weston_seat_release(context->item.seat); */ > + wl_list_remove(&seat->link); > + if (seat->saved_kbd_focus) > + wl_list_remove(&seat->saved_kbd_focus_listener.link); > + wl_global_destroy(seat->global); Hi, are you sure destroying the global is ok? Ah, but the thing you want to keep are the *existing* protocol objects. I'd like to have a little more explanation in the code comment on why this is so strangely coded, and what it actually achieves. > + wl_signal_emit(&seat->destroy_signal, seat); > + Feel free to add that comment and push. These two patches are Acked-by: Pekka Paalanen <pekka.paala...@collabora.co.uk> I think it is ok to land these before RC2. Thanks, pq _______________________________________________ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel