fix memory leak.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26815 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2008-10-08 15:12:49 +00:00
parent b90919e48b
commit 47020302ae

View File

@ -42,7 +42,11 @@ static bool moveItem(Paragraph & fromPar, pos_type fromPos,
if (Inset * tmpInset = fromPar.getInset(fromPos)) {
fromPar.releaseInset(fromPos);
// The inset is not in fromPar any more.
return toPar.insertInset(toPos, tmpInset, tmpFont, tmpChange);
if (!toPar.insertInset(toPos, tmpInset, tmpFont, tmpChange)) {
delete tmpInset;
return false;
}
return true;
}
char_type const tmpChar = fromPar.getChar(fromPos);