Fixed a memleak (CONDITIONAL_MENU).
This commit is contained in:
parent
6cb57f100a
commit
83171482b3
|
@ -24,6 +24,15 @@
|
||||||
|
|
||||||
#include "conditional_menu.h"
|
#include "conditional_menu.h"
|
||||||
|
|
||||||
|
CONDITIONAL_MENU::~CONDITIONAL_MENU()
|
||||||
|
{
|
||||||
|
for( std::list<ENTRY>::iterator it = m_entries.begin(); it != m_entries.end(); ++it )
|
||||||
|
{
|
||||||
|
if( it->Type() == ENTRY::MENU )
|
||||||
|
delete it->Menu();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void CONDITIONAL_MENU::AddItem( const TOOL_ACTION& aAction, const SELECTION_CONDITION& aCondition,
|
void CONDITIONAL_MENU::AddItem( const TOOL_ACTION& aAction, const SELECTION_CONDITION& aCondition,
|
||||||
int aOrder )
|
int aOrder )
|
||||||
|
|
|
@ -35,6 +35,9 @@ class SELECTION_TOOL;
|
||||||
class CONDITIONAL_MENU
|
class CONDITIONAL_MENU
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
CONDITIONAL_MENU() {}
|
||||||
|
~CONDITIONAL_MENU();
|
||||||
|
|
||||||
///> Constant to indicate that we do not care about an ENTRY location in the menu.
|
///> Constant to indicate that we do not care about an ENTRY location in the menu.
|
||||||
static const int ANY_ORDER = -1;
|
static const int ANY_ORDER = -1;
|
||||||
|
|
||||||
|
@ -54,7 +57,8 @@ public:
|
||||||
/**
|
/**
|
||||||
* Function AddMenu()
|
* Function AddMenu()
|
||||||
*
|
*
|
||||||
* Adds a submenu to the menu.
|
* Adds a submenu to the menu. CONDITIONAL_MENU takes ownership of the added menu, so it will
|
||||||
|
* be freed when the CONDITIONAL_MENU object is destroyed.
|
||||||
* @param aMenu is the submenu to be added.
|
* @param aMenu is the submenu to be added.
|
||||||
* @param aLabel is the label of added submenu.
|
* @param aLabel is the label of added submenu.
|
||||||
* @param aExpand determines if the added submenu items should be added as individual items
|
* @param aExpand determines if the added submenu items should be added as individual items
|
||||||
|
|
Loading…
Reference in New Issue