From 47020302aebfa64bff4b1e3a27ab4fe9e848e326 Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Wed, 8 Oct 2008 15:12:49 +0000 Subject: [PATCH] fix memory leak. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26815 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/paragraph_funcs.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/paragraph_funcs.cpp b/src/paragraph_funcs.cpp index f771391560..d8a7a858fb 100644 --- a/src/paragraph_funcs.cpp +++ b/src/paragraph_funcs.cpp @@ -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); -- 2.39.2