BASIC : use std::unique_ptr for storing SbiExprList
Change-Id: I37f2a1c837c6742cf6d403962d2730b5e80004ec Reviewed-on: https://gerrit.libreoffice.org/22345 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
This commit is contained in:
committed by
Noel Grandin
parent
7b7ffedfa6
commit
f17a4694b0
@@ -58,7 +58,7 @@ SbiExprNode::SbiExprNode( const OUString& rVal ):
|
||||
{
|
||||
}
|
||||
|
||||
SbiExprNode::SbiExprNode( const SbiSymDef& r, SbxDataType t, SbiExprList* l ) :
|
||||
SbiExprNode::SbiExprNode( const SbiSymDef& r, SbxDataType t, SbiExprListPtr l ) :
|
||||
pWithParent(nullptr),
|
||||
eNodeType(SbxVARVAL),
|
||||
eTok(NIL),
|
||||
@@ -66,7 +66,7 @@ SbiExprNode::SbiExprNode( const SbiSymDef& r, SbxDataType t, SbiExprList* l ) :
|
||||
{
|
||||
eType = ( t == SbxVARIANT ) ? r.GetType() : t;
|
||||
aVar.pDef = const_cast<SbiSymDef*>(&r);
|
||||
aVar.pPar = l;
|
||||
aVar.pPar = l.release();
|
||||
aVar.pvMorePar = nullptr;
|
||||
aVar.pNext= nullptr;
|
||||
}
|
||||
@@ -109,13 +109,7 @@ SbiExprNode::~SbiExprNode()
|
||||
{
|
||||
delete aVar.pPar;
|
||||
delete aVar.pNext;
|
||||
SbiExprListVector* pvMorePar = aVar.pvMorePar;
|
||||
if( pvMorePar )
|
||||
{
|
||||
for( const auto& pParam : *pvMorePar )
|
||||
delete pParam;
|
||||
delete pvMorePar;
|
||||
}
|
||||
delete aVar.pvMorePar;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user