From d70e6c2c697c933e81beb62badd810485e7f5aad Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Sun, 20 Dec 2020 17:27:54 +0200 Subject: [PATCH] Avoid destroying yet alive color devices This is a typo that I forgot to fix, therefore not requesting code review. After QVector::erase() has been called, we cannot use the iterator as it will lead to undefined behavior. --- colormanager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/colormanager.cpp b/colormanager.cpp index ef238f0a60..93beb10a06 100644 --- a/colormanager.cpp +++ b/colormanager.cpp @@ -70,7 +70,7 @@ void ColorManager::handleOutputDisabled(AbstractOutput *output) ColorDevice *device = *it; d->devices.erase(it); emit deviceRemoved(device); - delete *it; + delete device; } } // namespace KWin