diff --git a/win32ss/gdi/eng/pdevobj.c b/win32ss/gdi/eng/pdevobj.c index e1f9da54c69..77dce0b0bfa 100644 --- a/win32ss/gdi/eng/pdevobj.c +++ b/win32ss/gdi/eng/pdevobj.c @@ -139,7 +139,7 @@ PDEVOBJ_vRelease( { gppdevList = ppdev->ppdevNext; } - else + else if (gppdevList) { PPDEVOBJ ppdevCurrent = gppdevList; BOOL found = FALSE; @@ -154,10 +154,6 @@ PDEVOBJ_vRelease( ppdevCurrent->ppdevNext = ppdev->ppdevNext; } - /* Is this the primary one ? */ - if (ppdev == gpmdev->ppdevGlobal) - gpmdev->ppdevGlobal = NULL; - /* Unload display driver */ EngUnloadImage(ppdev->pldev);