Add missing clear of children memory in outline node
This commit is contained in:
parent
7c44dbd9d6
commit
8f52821cd4
|
@ -840,9 +840,9 @@ void PDF_PLOTTER::ClosePage()
|
||||||
VECTOR2I bottomLeft = iuToPdfUserSpace( box.GetPosition() );
|
VECTOR2I bottomLeft = iuToPdfUserSpace( box.GetPosition() );
|
||||||
VECTOR2I topRight = iuToPdfUserSpace( box.GetEnd() );
|
VECTOR2I topRight = iuToPdfUserSpace( box.GetEnd() );
|
||||||
|
|
||||||
int curr_actionHandle = emitGoToAction( pageHandle, bottomLeft, topRight );
|
actionHandle = emitGoToAction( pageHandle, bottomLeft, topRight );
|
||||||
|
|
||||||
addOutlineNode( groupOutlineNode, curr_actionHandle, ref );
|
addOutlineNode( groupOutlineNode, actionHandle, ref );
|
||||||
}
|
}
|
||||||
|
|
||||||
std::sort( groupOutlineNode->children.begin(), groupOutlineNode->children.end(),
|
std::sort( groupOutlineNode->children.begin(), groupOutlineNode->children.end(),
|
||||||
|
|
|
@ -367,11 +367,20 @@ public:
|
||||||
protected:
|
protected:
|
||||||
struct OUTLINE_NODE
|
struct OUTLINE_NODE
|
||||||
{
|
{
|
||||||
int actionHandle; //< Handle to action
|
int actionHandle; ///< Handle to action
|
||||||
wxString title; //< Title of outline node
|
wxString title; ///< Title of outline node
|
||||||
int entryHandle; //< Allocated handle for this outline entry
|
int entryHandle; ///< Allocated handle for this outline entry
|
||||||
|
|
||||||
std::vector<OUTLINE_NODE*> children;
|
std::vector<OUTLINE_NODE*> children; ///< Ordered list of children
|
||||||
|
|
||||||
|
~OUTLINE_NODE()
|
||||||
|
{
|
||||||
|
std::for_each( children.begin(), children.end(),
|
||||||
|
[]( OUTLINE_NODE* node )
|
||||||
|
{
|
||||||
|
delete node;
|
||||||
|
} );
|
||||||
|
}
|
||||||
|
|
||||||
OUTLINE_NODE* AddChild( int aActionHandle, const wxString& aTitle, int aEntryHandle )
|
OUTLINE_NODE* AddChild( int aActionHandle, const wxString& aTitle, int aEntryHandle )
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue