diff options
author | Aaron Plattner <aplattner@nvidia.com> | 2013-01-23 16:58:47 -0800 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2013-02-11 22:28:24 -0800 |
commit | 7115f6c709898a5124b67e19c61dc01334471358 (patch) | |
tree | 110496c21d05e96dbc962231e0f0ed5733ebcfda /randr | |
parent | da92690107d90061205340d4cdc98b73b59db9b2 (diff) |
randr: unref the provider shared pixmap the appropriate number of times
When an RandR shared pixmap is created in rrCreateSharedPixmap, it has a refcnt
of 1. Then, PixmapShareToSlave bumps the refcnt to 2. However, there's no
corresponding PixmapUnshareFromSlave where the refcnt can be decreased again,
and there's no convenient common place where the refcnt can be decremented when
the slave pixmap is destroyed.
Fix this by just unreffing the pixmap twice in RRCrtcDetachScanoutPixmap.
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'randr')
-rw-r--r-- | randr/rrcrtc.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c index e82d050e3..6e2eca5ad 100644 --- a/randr/rrcrtc.c +++ b/randr/rrcrtc.c @@ -372,6 +372,11 @@ RRCrtcDetachScanoutPixmap(RRCrtcPtr crtc) ret = pScrPriv->rrCrtcSetScanoutPixmap(crtc, NULL); if (crtc->scanout_pixmap) { master->StopPixmapTracking(mscreenpix, crtc->scanout_pixmap); + /* + * Unref the pixmap twice: once for the original reference, and once + * for the reference implicitly added by PixmapShareToSlave. + */ + master->DestroyPixmap(crtc->scanout_pixmap->master_pixmap); master->DestroyPixmap(crtc->scanout_pixmap->master_pixmap); crtc->pScreen->DestroyPixmap(crtc->scanout_pixmap); } |