xserver: Branch 'server-1.3-branch'

Keith Packard keithp at kemper.freedesktop.org
Fri Mar 16 05:25:43 EET 2007


 randr/rrcrtc.c   |    2 ++
 randr/rroutput.c |    5 ++++-
 2 files changed, 6 insertions(+), 1 deletion(-)

New commits:
diff-tree f521308ad2c06afa00143d3ab407e18d5293d497 (from b14f003b0ed1252766c9e3b1c086ea2809521047)
Author: Keith Packard <keithp at guitar.keithp.com>
Date:   Thu Mar 15 20:26:07 2007 -0700

    Correct ref counting of RRMode structures
    
    RRModes are referenced by the resource db, RROutput and RRCrtc structures.
    Ensure that the mode reference count is decremented each time a reference is
    lost from one of these sources. The missing destroys were in
    RRCrtcDestroyResource and RROutputDestroyResource, which only happen at
    server reset time, so modes would be unavailable in subsequent server
    generations.

diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c
index 43a6fca..1b3c230 100644
--- a/randr/rrcrtc.c
+++ b/randr/rrcrtc.c
@@ -370,6 +370,8 @@ RRCrtcDestroyResource (pointer value, XI
     }
     if (crtc->gammaRed)
 	xfree (crtc->gammaRed);
+    if (crtc->mode)
+	RRModeDestroy (crtc->mode);
     xfree (crtc);
     return 1;
 }
diff --git a/randr/rroutput.c b/randr/rroutput.c
index 31ec924..09f2afd 100644
--- a/randr/rroutput.c
+++ b/randr/rroutput.c
@@ -406,9 +406,12 @@ RROutputDestroyResource (pointer value, 
 	    }
 	}
     }
-    /* XXX destroy all modes? */
     if (output->modes)
+    {
+	for (m = 0; m < output->numModes; m++)
+	    RRModeDestroy (output->modes[m]);
 	xfree (output->modes);
+    }
     
     for (m = 0; m < output->numUserModes; m++)
 	RRModeDestroy (output->userModes[m]);



More information about the xorg-commit mailing list