From 2f08c8882155b1158548f1c34b100f58a7b63f01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20Gullik=20Bj=C3=B8nnes?= Date: Mon, 5 Jun 2000 19:36:14 +0000 Subject: [PATCH] a little bit saver buffer closing git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@792 a592a061-630c-0410-9148-cb99ea01b6c8 --- ChangeLog | 4 ++++ src/bufferlist.C | 13 ++++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 982ad62f92..4aa581565b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2000-06-05 Lars Gullik Bjønnes + + * src/bufferlist.C (close): test of buf->getuser() == NULL + 2000-06-02 Dekel Tsur * src/BufferView2.C (removeAutoInsets): Fix a bug: diff --git a/src/bufferlist.C b/src/bufferlist.C index 68be219fdd..448a01af27 100644 --- a/src/bufferlist.C +++ b/src/bufferlist.C @@ -151,10 +151,13 @@ void BufferList::resize() bool BufferList::close(Buffer * buf) { - if (buf->getUser()) buf->getUser()->insetUnlock(); + // CHECK + // Trace back why we need to use buf->getUser here. + // Perhaps slight rewrite is in order? (Lgb) + if (buf->getUser()) buf->getUser()->insetUnlock(); if (buf->paragraph && !buf->isLyxClean() && !quitting) { - ProhibitInput(buf->getUser()); + if (buf->getUser()) ProhibitInput(buf->getUser()); switch(AskConfirmation(_("Changes in document:"), MakeDisplayPath(buf->fileName(), 50), _("Save document?"))){ @@ -162,15 +165,15 @@ bool BufferList::close(Buffer * buf) if (buf->save()) { lastfiles->newFile(buf->fileName()); } else { - AllowInput(buf->getUser()); + if (buf->getUser()) AllowInput(buf->getUser()); return false; } break; case 3: // Cancel - AllowInput(buf->getUser()); + if (buf->getUser()) AllowInput(buf->getUser()); return false; } - AllowInput(buf->getUser()); + if (buf->getUser()) AllowInput(buf->getUser()); } bstore.release(buf);