diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c index 315dd6c08..ecf5bb251 100644 --- a/randr/rrcrtc.c +++ b/randr/rrcrtc.c @@ -361,6 +361,8 @@ RRCrtcDestroyResource (pointer value, XID pid) } 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 6e95c9598..160071bcf 100644 --- a/randr/rroutput.c +++ b/randr/rroutput.c @@ -406,9 +406,12 @@ RROutputDestroyResource (pointer value, XID pid) } } } - /* 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]);