diff options
author | Keith Packard <keithp@guitar.keithp.com> | 2007-03-15 20:26:07 -0700 |
---|---|---|
committer | Keith Packard <keithp@neko.keithp.com> | 2007-03-17 23:38:28 -0700 |
commit | 2489dae9f7def788910eee5733931392df83a0d6 (patch) | |
tree | 685d1ec9986030c16ce3afb593cc0774ed1f7def /randr/rroutput.c | |
parent | 9d0c3b52f25df89738fb1a62ccffda8c8cbb4689 (diff) |
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.
Diffstat (limited to 'randr/rroutput.c')
-rw-r--r-- | randr/rroutput.c | 5 |
1 files changed, 4 insertions, 1 deletions
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]); |