From 5bccde749db93296b7784e4cdc5e54c4443656c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Wed, 2 Dec 2015 18:21:12 +0900 Subject: [PATCH] randr: Stop dirty tracking for shared pixmap being destroyed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Otherwise, we leave a dangling reference to the destroyed pixmap in the master screen's pixmap_dirty_list. Fixes regression from commit cf5d6414 ("randr: Factor out shared pixmap destruction"). Reviewed-by: Adam Jackson Signed-off-by: Michel Dänzer --- randr/rrcrtc.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c index 8d9c5bb05..ec26fcda4 100644 --- a/randr/rrcrtc.c +++ b/randr/rrcrtc.c @@ -363,13 +363,18 @@ RRComputeContiguity(ScreenPtr pScreen) static void rrDestroySharedPixmap(RRCrtcPtr crtc, PixmapPtr pPixmap) { - if (crtc->pScreen->current_master && pPixmap->master_pixmap) { + ScreenPtr master = crtc->pScreen->current_master; + + if (master && pPixmap->master_pixmap) { + PixmapPtr mscreenpix = master->GetScreenPixmap(master); + + master->StopPixmapTracking(mscreenpix, pPixmap); /* * Unref the pixmap twice: once for the original reference, and once * for the reference implicitly added by PixmapShareToSlave. */ - crtc->pScreen->current_master->DestroyPixmap(pPixmap->master_pixmap); - crtc->pScreen->current_master->DestroyPixmap(pPixmap->master_pixmap); + master->DestroyPixmap(pPixmap->master_pixmap); + master->DestroyPixmap(pPixmap->master_pixmap); } crtc->pScreen->DestroyPixmap(pPixmap);