Don't bump the refcnt if the new mode is NULL.

This commit is contained in:
Eric Anholt 2006-11-03 16:36:34 -08:00
parent 4056e6e79a
commit cde8806c29

View File

@ -174,7 +174,8 @@ RRCrtcNotify (RRCrtcPtr crtc,
if (crtc->mode) if (crtc->mode)
RRModeDestroy (crtc->mode); RRModeDestroy (crtc->mode);
crtc->mode = mode; crtc->mode = mode;
mode->refcnt++; if (mode != NULL)
mode->refcnt++;
RRCrtcChanged (crtc, TRUE); RRCrtcChanged (crtc, TRUE);
} }
if (x != crtc->x) if (x != crtc->x)