mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-23 10:18:50 +00:00
Fix crash on exit because of static dummy Buffer.
* Inset::buffer(): replace dummy buffer with exception throwing. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23306 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
77f2d2e7d2
commit
d4cacf3642
@ -34,11 +34,14 @@
|
|||||||
|
|
||||||
#include "support/convert.h"
|
#include "support/convert.h"
|
||||||
#include "support/debug.h"
|
#include "support/debug.h"
|
||||||
|
#include "support/docstream.h"
|
||||||
|
#include "support/ExceptionMessage.h"
|
||||||
#include "support/gettext.h"
|
#include "support/gettext.h"
|
||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
using namespace lyx::support;
|
||||||
|
|
||||||
namespace lyx {
|
namespace lyx {
|
||||||
|
|
||||||
@ -122,19 +125,15 @@ void Inset::setBuffer(Buffer & buffer)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static Buffer & theDummyBuffer()
|
|
||||||
{
|
|
||||||
static Buffer dummyBuffer("nobuffer.lyx", true);
|
|
||||||
return dummyBuffer;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Buffer & Inset::buffer()
|
Buffer & Inset::buffer()
|
||||||
{
|
{
|
||||||
if (buffer_)
|
if (!buffer_) {
|
||||||
return *buffer_;
|
odocstringstream s;
|
||||||
LYXERR0("DUMMYBUFFER FOR " << lyxCode());
|
s << "LyX Code: " << lyxCode();
|
||||||
return theDummyBuffer();
|
throw ExceptionMessage(WarningException,
|
||||||
|
from_ascii("Inset::buffer_ member not initialized!"), s.str());
|
||||||
|
}
|
||||||
|
return *buffer_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user