]> git.lyx.org Git - features.git/commitdiff
When destructing a workarea, ignore buffer exceptions
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Fri, 31 Mar 2017 09:16:08 +0000 (11:16 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Fri, 31 Mar 2017 09:17:00 +0000 (11:17 +0200)
Spotted by coverity, but probably harmless.

src/frontends/qt4/GuiWorkArea.cpp

index b87bb48f4cb09687ecf66d95329c93162646fcf5..084377231f170ff164357e154e2a4402874eeba7 100644 (file)
@@ -341,7 +341,10 @@ void GuiWorkArea::init()
 
 GuiWorkArea::~GuiWorkArea()
 {
-       d->buffer_view_->buffer().workAreaManager().remove(this);
+       // If something is wrong with the buffer, we can ignore it safely
+       try {
+               d->buffer_view_->buffer().workAreaManager().remove(this);
+       } catch(...) {}
        delete d->screen_;
        delete d->buffer_view_;
        delete d->cursor_;