randr: Stop dirty tracking for shared pixmap being destroyed
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 <ajax@redhat.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
			
			
This commit is contained in:
		
				
					committed by
					
						
						Adam Jackson
					
				
			
			
				
	
			
			
			
						parent
						
							2e3d9623ae
						
					
				
				
					commit
					5bccde749d
				
			@@ -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);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user