]> git.lyx.org Git - features.git/commitdiff
Add a check to please coverity.
authorRichard Heck <rgheck@lyx.org>
Sun, 12 Jun 2016 04:12:03 +0000 (00:12 -0400)
committerRichard Heck <rgheck@lyx.org>
Sun, 12 Jun 2016 04:12:03 +0000 (00:12 -0400)
Fixes #23496.

src/frontends/qt4/GuiView.cpp
src/frontends/qt4/InGuiThread.h

index fc2170d1064b67ba338a80f2e7fe96f87a4fb73a..87ee553df298e2bdabab384311a4918e542865d5 100644 (file)
@@ -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());
 }
 
 
index 65fd648fffb263ee62392094eec1b68d2b4986b1..86c4afee502b6ebae910eb25a60780996a89d45c 100644 (file)
@@ -52,7 +52,8 @@ class InGuiThread : private IntoGuiThreadMover
 {
 public:
 
-       InGuiThread() {}
+       // please coverity by explicitly initalizing this variable.
+       InGuiThread() : return_value_(R()) {}
 
        template<class F>
        R call(F f)