Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
e37b07a6
Commit
e37b07a6
authored
Apr 30, 2015
by
Maciej Suminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Explicit destruction of menu entries in CONTEXT_MENU.
parent
b218c109
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
context_menu.cpp
common/tool/context_menu.cpp
+5
-5
No files found.
common/tool/context_menu.cpp
View file @
e37b07a6
...
@@ -152,7 +152,7 @@ std::list<wxMenuItem*> CONTEXT_MENU::Add( CONTEXT_MENU* aMenu, const wxString& a
...
@@ -152,7 +152,7 @@ std::list<wxMenuItem*> CONTEXT_MENU::Add( CONTEXT_MENU* aMenu, const wxString& a
if
(
aExpand
)
if
(
aExpand
)
{
{
for
(
unsigned
int
i
=
0
;
i
<
aMenu
->
GetMenuItemCount
();
++
i
)
for
(
int
i
=
0
;
i
<
(
int
)
aMenu
->
GetMenuItemCount
();
++
i
)
{
{
wxMenuItem
*
item
=
aMenu
->
FindItemByPosition
(
i
);
wxMenuItem
*
item
=
aMenu
->
FindItemByPosition
(
i
);
items
.
push_back
(
appendCopy
(
item
)
);
items
.
push_back
(
appendCopy
(
item
)
);
...
@@ -184,10 +184,10 @@ void CONTEXT_MENU::Clear()
...
@@ -184,10 +184,10 @@ void CONTEXT_MENU::Clear()
{
{
m_titleSet
=
false
;
m_titleSet
=
false
;
GetMenuItems
().
DeleteContents
(
true
);
for
(
int
i
=
GetMenuItemCount
()
-
1
;
i
>=
0
;
--
i
)
GetMenuItems
().
Clear
();
Destroy
(
FindItemByPosition
(
i
)
);
m_toolActions
.
clear
();
m_toolActions
.
clear
();
GetMenuItems
().
DeleteContents
(
false
);
// restore the default so destructor does not go wild
m_submenus
.
clear
();
m_submenus
.
clear
();
m_parent
=
NULL
;
m_parent
=
NULL
;
...
@@ -333,7 +333,7 @@ void CONTEXT_MENU::copyFrom( const CONTEXT_MENU& aMenu )
...
@@ -333,7 +333,7 @@ void CONTEXT_MENU::copyFrom( const CONTEXT_MENU& aMenu )
m_update_handler
=
aMenu
.
m_update_handler
;
m_update_handler
=
aMenu
.
m_update_handler
;
// Copy all the menu entries
// Copy all the menu entries
for
(
unsigned
i
=
0
;
i
<
aMenu
.
GetMenuItemCount
();
++
i
)
for
(
int
i
=
0
;
i
<
(
int
)
aMenu
.
GetMenuItemCount
();
++
i
)
{
{
wxMenuItem
*
item
=
aMenu
.
FindItemByPosition
(
i
);
wxMenuItem
*
item
=
aMenu
.
FindItemByPosition
(
i
);
appendCopy
(
item
);
appendCopy
(
item
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment