When cleaning duplicate modes, make sure ->Last is reset correctly.

When removing the very last mode for a monitor, move the ->Last pointer to
the previous list element.
This commit is contained in:
Keith Packard 2006-12-21 21:20:43 -08:00
parent fab9a6b621
commit d8c5dba4d7
1 changed files with 4 additions and 0 deletions

View File

@ -437,7 +437,11 @@ xf86PruneDuplicateMonitorModes (MonPtr Monitor)
{
next = clone->next;
if (xf86ModesEqual (master, clone))
{
if (Monitor->Last == clone)
Monitor->Last = clone->prev;
xf86DeleteMode (&Monitor->Modes, clone);
}
}
}
}