[Spice-devel] [PATCH spice-gtk] RFC: always release shm of primary surfaces

Hans de Goede hdegoede at redhat.com
Thu Mar 22 02:14:26 PDT 2012


ACK!

On 03/21/2012 07:53 PM, Marc-André Lureau wrote:
> Note: I can't reproduce the leak, even after dozen of resolution switch.
>
> Always delete shared memory segment of primary surfaces when
> destroying its canvas.
> ---
>   gtk/channel-display.c |    6 +-----
>   1 files changed, 1 insertions(+), 5 deletions(-)
>
> diff --git a/gtk/channel-display.c b/gtk/channel-display.c
> index 152d6a7..8269705 100644
> --- a/gtk/channel-display.c
> +++ b/gtk/channel-display.c
> @@ -705,6 +705,7 @@ static void destroy_canvas(display_surface *surface)
>   #ifdef HAVE_SYS_SHM_H
>       else {
>           shmdt(surface->data);
> +        shmctl(surface->shmid, IPC_RMID, 0);
>       }
>   #endif
>       surface->shmid = -1;
> @@ -815,11 +816,6 @@ static void display_handle_mode(SpiceChannel *channel, SpiceMsgIn *in)
>       surface->size    = surface->height * surface->stride;
>       surface->primary = true;
>       create_canvas(channel, surface);
> -#ifdef HAVE_SYS_SHM_H
> -    if (surface->shmid != -1) {
> -        shmctl(surface->shmid, IPC_RMID, 0);
> -    }
> -#endif
>   }
>
>   /* coroutine context */


More information about the Spice-devel mailing list