Make sure MarkAsExporting is deleted before buffer

This fixes a crash when cutting something.
This commit is contained in:
Vincent van Ravesteijn 2013-04-28 18:47:11 +02:00
parent ea118f2da5
commit e115b006e6

View File

@ -504,6 +504,8 @@ void putClipboard(ParagraphList const & paragraphs,
// applications, the number that can parse it should go up in the future. // applications, the number that can parse it should go up in the future.
buffer->params().html_math_output = BufferParams::MathML; buffer->params().html_math_output = BufferParams::MathML;
// Make sure MarkAsExporting is deleted before buffer is
{
// The Buffer is being used to export. This is necessary so that the // The Buffer is being used to export. This is necessary so that the
// updateMacros call will record the needed information. // updateMacros call will record the needed information.
MarkAsExporting mex(buffer); MarkAsExporting mex(buffer);
@ -524,6 +526,7 @@ void putClipboard(ParagraphList const & paragraphs,
buffer->writeLyXHTMLSource(oshtml, runparams, Buffer::FullSource); buffer->writeLyXHTMLSource(oshtml, runparams, Buffer::FullSource);
theClipboard().put(lyx, oshtml.str(), plaintext); theClipboard().put(lyx, oshtml.str(), plaintext);
}
// Save that memory // Save that memory
delete buffer; delete buffer;