diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2014-04-04 17:46:33 +0200 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@redhat.com> | 2014-04-15 15:51:00 +0200 |
commit | a7e80610e8a7b616b3e502a39052921fb9b51825 (patch) | |
tree | cd2839b88a63b0725552f6630de9d4ac907ecf82 | |
parent | 3d8deef5f365be5078654bfdb916aba2d0025342 (diff) |
display: signal primary-destroy when clearing all surfaces
When destroying the primary surface, we need to signal it, since
listeners might be referencing the data pointer. Currently, this only
happens during channel finalize().
This could help with rhbz#1082555.
-rw-r--r-- | gtk/channel-display.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gtk/channel-display.c b/gtk/channel-display.c index 96fd764..ff9f85c 100644 --- a/gtk/channel-display.c +++ b/gtk/channel-display.c @@ -807,12 +807,18 @@ static display_surface *find_surface(SpiceDisplayChannelPrivate *c, guint32 surf return g_hash_table_lookup(c->surfaces, GINT_TO_POINTER(surface_id)); } +/* main or coroutine context */ static void clear_surfaces(SpiceChannel *channel, gboolean keep_primary) { SpiceDisplayChannelPrivate *c = SPICE_DISPLAY_CHANNEL(channel)->priv; GHashTableIter iter; display_surface *surface; + if (!keep_primary) { + c->primary = NULL; + emit_main_context(channel, SPICE_DISPLAY_PRIMARY_DESTROY); + } + g_hash_table_iter_init(&iter, c->surfaces); while (g_hash_table_iter_next(&iter, NULL, (gpointer*)&surface)) { |