Mercurial > octave
changeset 25102:65b7380655f2 stable
prevent crash if help data could not be set up (bug #53006)
* documentation.cc (documentation): return before creating documentation
widget if help data failed to be set up;
(~documentation): remove tmp files even if help engine is null pointer
author | Torsten <mttl@mailbox.org> |
---|---|
date | Tue, 03 Apr 2018 21:48:53 +0200 |
parents | 29641449ca90 |
children | 078b795c5219 |
files | libgui/src/documentation.cc |
diffstat | 1 files changed, 8 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/libgui/src/documentation.cc Tue Apr 03 21:48:33 2018 +0200 +++ b/libgui/src/documentation.cc Tue Apr 03 21:48:53 2018 +0200 @@ -87,10 +87,9 @@ "documentation viewer. Only help texts in\n" "the Console Widget will be available.")); if (m_help_engine) - { - delete m_help_engine; - m_help_engine = 0; - } + delete m_help_engine; + m_help_engine = 0; + return; } // The browser @@ -188,11 +187,12 @@ documentation::~documentation (void) { if (m_help_engine) - { - delete m_help_engine; + delete m_help_engine; - // Cleanup temporary file and directory - QFile file (m_collection); + // Cleanup temporary file and directory + QFile file (m_collection); + if (file.exists ()) + { QFileInfo finfo (file); QString bname = finfo.fileName (); QDir dir = finfo.absoluteDir ();