check if theApp is valid

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15973 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Peter Kümmel 2006-11-19 11:10:04 +00:00
parent 35204f8f33
commit d32701179e
2 changed files with 2 additions and 0 deletions

View File

@ -417,6 +417,7 @@ void LyX::quit()
pimpl_->lyx_server_.reset(); pimpl_->lyx_server_.reset();
pimpl_->lyx_socket_.reset(); pimpl_->lyx_socket_.reset();
pimpl_->application_->exit(0); pimpl_->application_->exit(0);
theApp = 0;
} }
} }

View File

@ -77,6 +77,7 @@ LyXServerSocket::LyXServerSocket(LyXFunc * f, string const & addr)
LyXServerSocket::~LyXServerSocket() LyXServerSocket::~LyXServerSocket()
{ {
if (fd_ != -1) { if (fd_ != -1) {
BOOST_ASSERT (theApp);
theApp->unregisterSocketCallback(fd_); theApp->unregisterSocketCallback(fd_);
if (::close(fd_) != 0) if (::close(fd_) != 0)
lyxerr << "lyx: Server socket " << fd_ lyxerr << "lyx: Server socket " << fd_