]> git.lyx.org Git - features.git/commitdiff
Make static variable non-static
authorGeorg Baum <baum@lyx.org>
Mon, 13 Apr 2015 19:07:05 +0000 (21:07 +0200)
committerGeorg Baum <baum@lyx.org>
Thu, 7 May 2015 18:24:02 +0000 (20:24 +0200)
This is still a hack, but a less dangerous one. The old code had a problem
if it was called from different threads, or if for some reason it would get
called recursively.

src/mathed/MacroTable.cpp

index 2d29f520e99657d65261c8645d477dd0dc313823..7a75a4f2b3932079627bd6967ce4ecf73e5bbd00 100644 (file)
@@ -68,8 +68,7 @@ bool MacroData::expand(vector<MathData> const & args, MathData & to) const
        updateData();
 
        // Hack. Any inset with a cell would do.
-       static InsetMathSqrt inset(0);
-       inset.setBuffer(const_cast<Buffer &>(*buffer_));
+       InsetMathSqrt inset(const_cast<Buffer *>(buffer_));
 
        docstring const & definition(display_.empty() ? definition_ : display_);
        asArray(definition, inset.cell(0));