Fix memory leak in Math, by holding SmModel pointer
And deleting this in destructor of SmDocShell Change-Id: Ida96648c7aae90fb5b0afac916587bbb049f90b3 Reviewed-on: https://gerrit.libreoffice.org/5088 Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org> Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
This commit is contained in:
committed by
Fridrich Strba
parent
2384be5364
commit
ef66cc105e
@@ -39,6 +39,7 @@
|
|||||||
#include "format.hxx"
|
#include "format.hxx"
|
||||||
#include "parse.hxx"
|
#include "parse.hxx"
|
||||||
#include "smmod.hxx"
|
#include "smmod.hxx"
|
||||||
|
#include "unomodel.hxx"
|
||||||
|
|
||||||
class SmNode;
|
class SmNode;
|
||||||
class SfxMenuBarManager;
|
class SfxMenuBarManager;
|
||||||
@@ -95,6 +96,7 @@ class SmDocShell : public SfxObjectShell, public SfxListener
|
|||||||
OUString aText;
|
OUString aText;
|
||||||
SmFormat aFormat;
|
SmFormat aFormat;
|
||||||
SmParser aInterpreter;
|
SmParser aInterpreter;
|
||||||
|
SmModel *pModel;
|
||||||
OUString aAccText;
|
OUString aAccText;
|
||||||
SmNode *pTree;
|
SmNode *pTree;
|
||||||
SfxMenuBarManager *pMenuMgr;
|
SfxMenuBarManager *pMenuMgr;
|
||||||
|
@@ -684,6 +684,7 @@ void SmDocShell::Repaint()
|
|||||||
|
|
||||||
SmDocShell::SmDocShell( const sal_uInt64 i_nSfxCreationFlags ) :
|
SmDocShell::SmDocShell( const sal_uInt64 i_nSfxCreationFlags ) :
|
||||||
SfxObjectShell( i_nSfxCreationFlags ),
|
SfxObjectShell( i_nSfxCreationFlags ),
|
||||||
|
pModel ( new SmModel(this) ),
|
||||||
pTree ( 0 ),
|
pTree ( 0 ),
|
||||||
pEditEngineItemPool ( 0 ),
|
pEditEngineItemPool ( 0 ),
|
||||||
pEditEngine ( 0 ),
|
pEditEngine ( 0 ),
|
||||||
@@ -703,11 +704,9 @@ SmDocShell::SmDocShell( const sal_uInt64 i_nSfxCreationFlags ) :
|
|||||||
StartListening(aFormat);
|
StartListening(aFormat);
|
||||||
StartListening(*pp->GetConfig());
|
StartListening(*pp->GetConfig());
|
||||||
|
|
||||||
SetBaseModel( new SmModel(this) );
|
SetBaseModel( pModel );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
SmDocShell::~SmDocShell()
|
SmDocShell::~SmDocShell()
|
||||||
{
|
{
|
||||||
SAL_INFO( "starmath", "starmath: SmDocShell::~SmDocShell" );
|
SAL_INFO( "starmath", "starmath: SmDocShell::~SmDocShell" );
|
||||||
@@ -717,7 +716,6 @@ SmDocShell::~SmDocShell()
|
|||||||
EndListening(aFormat);
|
EndListening(aFormat);
|
||||||
EndListening(*pp->GetConfig());
|
EndListening(*pp->GetConfig());
|
||||||
|
|
||||||
|
|
||||||
if(pCursor)
|
if(pCursor)
|
||||||
delete pCursor;
|
delete pCursor;
|
||||||
pCursor = NULL;
|
pCursor = NULL;
|
||||||
@@ -726,6 +724,7 @@ SmDocShell::~SmDocShell()
|
|||||||
SfxItemPool::Free(pEditEngineItemPool);
|
SfxItemPool::Free(pEditEngineItemPool);
|
||||||
delete pTree;
|
delete pTree;
|
||||||
delete pPrinter;
|
delete pPrinter;
|
||||||
|
delete pModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user