From 07f95ae652a6c1bd1bfde55f5ca773efca10a8ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaakko=20Ker=C3=A4nen?= Date: Sat, 23 Nov 2013 18:14:04 +0200 Subject: [PATCH] Client|LogWidget: Avoid a race condition in the log sink It was possible that when entries are added into the MemoryLogSink, there was a situation where an invalid index was accessed (likely due to a purge occurring in the background). --- doomsday/client/src/ui/widgets/logwidget.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doomsday/client/src/ui/widgets/logwidget.cpp b/doomsday/client/src/ui/widgets/logwidget.cpp index 0169ba059a..330dff39ca 100644 --- a/doomsday/client/src/ui/widgets/logwidget.cpp +++ b/doomsday/client/src/ui/widgets/logwidget.cpp @@ -242,6 +242,8 @@ public Font::RichFormat::IStyle */ void beginWorkOnNext() { + DENG2_GUARD(this); + while(_width > 0 && _next >= 0 && _next < entryCount()) { LogEntry const &ent = entry(_next);