Fix memory leak
Change-Id: I9e271c3b7ff49d33f4f6f3f8c50b70ac5ce1541e
This commit is contained in:
@@ -122,6 +122,7 @@
|
|||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <set>
|
#include <set>
|
||||||
|
#include <utility>
|
||||||
#include <rtl/strbuf.hxx>
|
#include <rtl/strbuf.hxx>
|
||||||
#include <tools/time.hxx>
|
#include <tools/time.hxx>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
@@ -1219,12 +1220,12 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi
|
|||||||
}
|
}
|
||||||
if (nRowCount > 0)
|
if (nRowCount > 0)
|
||||||
{
|
{
|
||||||
sal_uInt32* pTableArry = new sal_uInt32[ nRowCount + 2 ];
|
std::unique_ptr<sal_uInt32[]> pTableArry(new sal_uInt32[ nRowCount + 2 ]);
|
||||||
pTableArry[ 0 ] = nTableProperties;
|
pTableArry[ 0 ] = nTableProperties;
|
||||||
pTableArry[ 1 ] = nRowCount;
|
pTableArry[ 1 ] = nRowCount;
|
||||||
for ( i = 0; i < nRowCount; i++ )
|
for ( i = 0; i < nRowCount; i++ )
|
||||||
rSt.ReadUInt32( pTableArry[ i + 2 ] );
|
rSt.ReadUInt32( pTableArry[ i + 2 ] );
|
||||||
rData.pTableRowProperties = pTableArry;
|
rData.pTableRowProperties = std::move(pTableArry);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2862,12 +2863,12 @@ void SdrPowerPointImport::ImportPage( SdrPage* pRet, const PptSlidePersistEntry*
|
|||||||
Rectangle aEmpty;
|
Rectangle aEmpty;
|
||||||
aShapeHd.SeekToBegOfRecord( rStCtrl );
|
aShapeHd.SeekToBegOfRecord( rStCtrl );
|
||||||
sal_Int32 nShapeId;
|
sal_Int32 nShapeId;
|
||||||
aProcessData.pTableRowProperties = nullptr;
|
aProcessData.pTableRowProperties.reset();
|
||||||
SdrObject* pObj = ImportObj( rStCtrl, static_cast<void*>(&aProcessData), aEmpty, aEmpty, 0, &nShapeId );
|
SdrObject* pObj = ImportObj( rStCtrl, static_cast<void*>(&aProcessData), aEmpty, aEmpty, 0, &nShapeId );
|
||||||
if ( pObj )
|
if ( pObj )
|
||||||
{
|
{
|
||||||
if ( aProcessData.pTableRowProperties )
|
if ( aProcessData.pTableRowProperties )
|
||||||
pObj = CreateTable( pObj, aProcessData.pTableRowProperties, aProcessData.rPersistEntry.pSolverContainer );
|
pObj = CreateTable( pObj, aProcessData.pTableRowProperties.get(), aProcessData.rPersistEntry.pSolverContainer );
|
||||||
|
|
||||||
pRet->NbcInsertObject( pObj );
|
pRet->NbcInsertObject( pObj );
|
||||||
|
|
||||||
|
@@ -508,13 +508,11 @@ struct ProcessData
|
|||||||
PptSlidePersistEntry& rPersistEntry;
|
PptSlidePersistEntry& rPersistEntry;
|
||||||
SdPageCapsule pPage;
|
SdPageCapsule pPage;
|
||||||
::std::vector< SdrObject* > aBackgroundColoredObjects;
|
::std::vector< SdrObject* > aBackgroundColoredObjects;
|
||||||
sal_uInt32* pTableRowProperties;
|
std::unique_ptr<sal_uInt32[]> pTableRowProperties;
|
||||||
|
|
||||||
ProcessData( PptSlidePersistEntry& rP, SdPageCapsule pP ) :
|
ProcessData( PptSlidePersistEntry& rP, SdPageCapsule pP ) :
|
||||||
rPersistEntry ( rP ),
|
rPersistEntry ( rP ),
|
||||||
pPage ( pP ),
|
pPage ( pP ) {};
|
||||||
pTableRowProperties ( nullptr ) {};
|
|
||||||
~ProcessData() { delete[] pTableRowProperties; };
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user