mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
Ensure that insetlist always contains non-null pointers to insets.
Fix a couple of possible memory leaks. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8546 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
6e600e84f8
commit
3f70e153ee
@ -1,3 +1,8 @@
|
||||
2004-03-27 Angus Leeming <leeming@lyx.org>
|
||||
|
||||
* paragraph_funcs.C (moveItem): fix memory leaks, ensure that
|
||||
insetlist always contains non-null pointers to insets.
|
||||
|
||||
2004-03-26 Angus Leeming <leeming@lyx.org>
|
||||
|
||||
* src/BufferView_pimpl.C:
|
||||
|
@ -68,11 +68,15 @@ bool moveItem(Paragraph & from, Paragraph & to,
|
||||
if (from.getInset(i)) {
|
||||
// the inset is not in a paragraph anymore
|
||||
tmpinset = from.insetlist.release(i);
|
||||
from.insetlist.erase(i);
|
||||
}
|
||||
|
||||
if (!to.insetAllowed(tmpinset->lyxCode()))
|
||||
if (!to.insetAllowed(tmpinset->lyxCode())) {
|
||||
delete tmpinset;
|
||||
return false;
|
||||
to.insertInset(j, tmpinset, tmpfont);
|
||||
}
|
||||
if (tmpinset)
|
||||
to.insertInset(j, tmpinset, tmpfont);
|
||||
} else {
|
||||
if (!to.checkInsertChar(tmpfont))
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user