From 7b15ea393ffc0710534b6072c4d4f7706f1b426e Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Sun, 12 Jun 2016 00:12:03 -0400 Subject: [PATCH] Add a check to please coverity. Fixes #23496. --- src/frontends/qt4/GuiView.cpp | 6 +++++- src/frontends/qt4/InGuiThread.h | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp index fc2170d106..87ee553df2 100644 --- a/src/frontends/qt4/GuiView.cpp +++ b/src/frontends/qt4/GuiView.cpp @@ -2751,9 +2751,13 @@ bool GuiView::closeWorkArea(GuiWorkArea * wa) bool GuiView::closeBuffer() { GuiWorkArea * wa = currentMainWorkArea(); + // coverity complained about this + // it seems unnecessary, but perhaps is worth the check + LASSERT(wa, return false); + setCurrentWorkArea(wa); Buffer & buf = wa->bufferView().buffer(); - return wa && closeWorkArea(wa, !buf.parent()); + return closeWorkArea(wa, !buf.parent()); } diff --git a/src/frontends/qt4/InGuiThread.h b/src/frontends/qt4/InGuiThread.h index 65fd648fff..86c4afee50 100644 --- a/src/frontends/qt4/InGuiThread.h +++ b/src/frontends/qt4/InGuiThread.h @@ -52,7 +52,8 @@ class InGuiThread : private IntoGuiThreadMover { public: - InGuiThread() {} + // please coverity by explicitly initalizing this variable. + InGuiThread() : return_value_(R()) {} template R call(F f) -- 2.39.2