mirror of
https://github.com/rt64/rt64.git
synced 2024-12-26 21:18:31 +00:00
Be extra cautious and only free XRRCrtcInfo if it's not nullptr in case the implementation doesn't handle it.
This commit is contained in:
parent
e52aa9eea1
commit
7d8954e734
@ -248,10 +248,13 @@ namespace RT64 {
|
|||||||
RRMode activeModeID = 0;
|
RRMode activeModeID = 0;
|
||||||
for (int i = 0; i < screenResources->ncrtc; ++i) {
|
for (int i = 0; i < screenResources->ncrtc; ++i) {
|
||||||
XRRCrtcInfo *crtcInfo = XRRGetCrtcInfo(windowHandle.display, screenResources, screenResources->crtcs[i]);
|
XRRCrtcInfo *crtcInfo = XRRGetCrtcInfo(windowHandle.display, screenResources, screenResources->crtcs[i]);
|
||||||
if ((crtcInfo != nullptr) && (crtcInfo->mode != 0L)) {
|
if (crtcInfo != nullptr) {
|
||||||
activeModeID = crtcInfo->mode;
|
if (crtcInfo->mode != 0L) {
|
||||||
|
activeModeID = crtcInfo->mode;
|
||||||
|
}
|
||||||
|
|
||||||
|
XRRFreeCrtcInfo(crtcInfo);
|
||||||
}
|
}
|
||||||
XRRFreeCrtcInfo(crtcInfo);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (activeModeID == 0L) {
|
if (activeModeID == 0L) {
|
||||||
@ -366,4 +369,4 @@ namespace RT64 {
|
|||||||
#else
|
#else
|
||||||
static_assert(false && "Unimplemented");
|
static_assert(false && "Unimplemented");
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user