Abdelrazak Younes wrote:
[EMAIL PROTECTED] wrote:
Author: rgheck
Date: Sun Jul 13 21:34:56 2008
New Revision: 25584
URL: http://www.lyx.org/trac/changeset/25584
Log:
Redo 25580 the right way. (Failure to initialize bparams had caused
constant crashes.)
Modified:
lyx-devel/trunk/src/Undo.cpp
Modified: lyx-devel/trunk/src/Undo.cpp
URL: http://www.lyx.org/trac/file/lyx-devel/trunk/src/Undo.cpp?rev=25584
==============================================================================
--- lyx-devel/trunk/src/Undo.cpp (original)
+++ lyx-devel/trunk/src/Undo.cpp Sun Jul 13 21:34:56 2008
@@ -73,8 +73,13 @@
MathData * ar, BufferParams const & bp,
bool ifb) :
kind(kin), cursor(cur), cell(cel), from(fro), end(en),
- pars(pl), array(ar), bparams(bp), isFullBuffer(ifb)
- {}
+ pars(pl), array(ar), bparams(0), isFullBuffer(ifb)
+ {
+ if (isFullBuffer)
+ bparams = new BufferParams(bp);
+ }
+ ///
+ ~UndoElement() { delete bparams; }
No, please replace that with
if (isFullBuffer)
delete bparams;
Because UndoElement do not own bparams in the other case.
OK, I didn't see that bparams was initialized to 0... still, I think we
don't loose much with the extra check.
Abdel.