1
0
Fork 0

Codechange: nullptr deletion in DeleteWindowById (#8941)

pull/8992/head
Didac Perez Parera 2021-04-10 02:19:14 -07:00 committed by GitHub
parent c64b0946e8
commit 0cb99c5523
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 2 deletions

View File

@ -1165,8 +1165,7 @@ Window *FindWindowByClass(WindowClass cls)
void DeleteWindowById(WindowClass cls, WindowNumber number, bool force) void DeleteWindowById(WindowClass cls, WindowNumber number, bool force)
{ {
Window *w = FindWindowById(cls, number); Window *w = FindWindowById(cls, number);
if (force || w == nullptr || if (w != nullptr && (force || (w->flags & WF_STICKY) == 0)) {
(w->flags & WF_STICKY) == 0) {
delete w; delete w;
} }
} }