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.
This commit is contained in:
parent
9d0c3b52f2
commit
2489dae9f7
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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]);
|
||||
|
|
Loading…
Reference in New Issue
Block a user