From 5eccf6ebc014bd314eec6494ffb2784111f1f3b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20K=C3=BCmmel?= Date: Wed, 29 Nov 2006 21:27:54 +0000 Subject: [PATCH] Fix crash on Mac Part 1: don't dereference untested pointers git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16108 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/lyx_main.C | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/lyx_main.C b/src/lyx_main.C index 3836cad648..94888113c9 100644 --- a/src/lyx_main.C +++ b/src/lyx_main.C @@ -450,12 +450,13 @@ void LyX::quit() lyxerr[Debug::INFO] << "Running QuitLyX." << endl; prepareExit(); - if (use_gui) { - pimpl_->session_->writeFile(); + if (pimpl_->session_) + pimpl_->session_->writeFile(); pimpl_->lyx_server_.reset(); pimpl_->lyx_socket_.reset(); - pimpl_->application_->exit(0); + if (pimpl_->application_) + pimpl_->application_->exit(0); theApp = 0; } } @@ -930,7 +931,8 @@ void LyX::emergencyCleanup() const pimpl_->buffer_list_.emergencyWriteAll(); if (use_gui) { - pimpl_->lyx_server_->emergencyCleanup(); + if (pimpl_->lyx_server_) + pimpl_->lyx_server_->emergencyCleanup(); pimpl_->lyx_server_.reset(); pimpl_->lyx_socket_.reset(); }