The branch, master, has been updated.

- Log -----------------------------------------------------------------

commit e115b006e666cf81d801c224ef36cc9abe272223
Author: Vincent van Ravesteijn <[email protected]>
Date:   Sun Apr 28 18:47:11 2013 +0200

    Make sure MarkAsExporting is deleted before buffer
    
    This fixes a crash when cutting something.

diff --git a/src/CutAndPaste.cpp b/src/CutAndPaste.cpp
index b0af875..35e7f74 100644
--- a/src/CutAndPaste.cpp
+++ b/src/CutAndPaste.cpp
@@ -504,26 +504,29 @@ void putClipboard(ParagraphList const & paragraphs,
        // applications, the number that can parse it should go up in the 
future.
        buffer->params().html_math_output = BufferParams::MathML;
 
-       // The Buffer is being used to export. This is necessary so that the
-       // updateMacros call will record the needed information.
-       MarkAsExporting mex(buffer);
-
-       buffer->updateBuffer(Buffer::UpdateMaster, OutputUpdate);
-       buffer->updateMacros();
-       buffer->updateMacroInstances(OutputUpdate);
-
-       // LyX's own format
-       string lyx;
-       ostringstream oslyx;
-       if (buffer->write(oslyx))
-               lyx = oslyx.str();
-
-       // XHTML format
-       odocstringstream oshtml;
-       OutputParams runparams(encodings.fromLyXName("utf8"));
-       buffer->writeLyXHTMLSource(oshtml, runparams, Buffer::FullSource);
-
-       theClipboard().put(lyx, oshtml.str(), plaintext);
+       // Make sure MarkAsExporting is deleted before buffer is
+       {
+               // The Buffer is being used to export. This is necessary so 
that the
+               // updateMacros call will record the needed information.
+               MarkAsExporting mex(buffer);
+
+               buffer->updateBuffer(Buffer::UpdateMaster, OutputUpdate);
+               buffer->updateMacros();
+               buffer->updateMacroInstances(OutputUpdate);
+
+               // LyX's own format
+               string lyx;
+               ostringstream oslyx;
+               if (buffer->write(oslyx))
+                       lyx = oslyx.str();
+
+               // XHTML format
+               odocstringstream oshtml;
+               OutputParams runparams(encodings.fromLyXName("utf8"));
+               buffer->writeLyXHTMLSource(oshtml, runparams, 
Buffer::FullSource);
+
+               theClipboard().put(lyx, oshtml.str(), plaintext);
+       }
 
        // Save that memory
        delete buffer;

-----------------------------------------------------------------------

Summary of changes:
 src/CutAndPaste.cpp |   43 +++++++++++++++++++++++--------------------
 1 files changed, 23 insertions(+), 20 deletions(-)


hooks/post-receive
-- 
The LyX Source Repository

Reply via email to