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
d13355f7
Commit
d13355f7
authored
Sep 11, 2013
by
Maciej Suminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed some potential memory leaks.
parent
f179183d
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
24 additions
and
2 deletions
+24
-2
tool_manager.cpp
common/tool/tool_manager.cpp
+13
-0
wxBasePcbFrame.h
include/wxBasePcbFrame.h
+2
-2
wxPcbStruct.h
include/wxPcbStruct.h
+1
-0
pcbframe.cpp
pcbnew/pcbframe.cpp
+1
-0
pcb_tools.cpp
pcbnew/tools/pcb_tools.cpp
+7
-0
No files found.
common/tool/tool_manager.cpp
View file @
d13355f7
...
...
@@ -86,6 +86,19 @@ TOOL_MANAGER::TOOL_MANAGER()
}
TOOL_MANAGER
::~
TOOL_MANAGER
()
{
std
::
map
<
TOOL_BASE
*
,
TOOL_STATE
*>::
iterator
it
,
it_end
;
for
(
it
=
m_toolState
.
begin
(),
it_end
=
m_toolState
.
end
();
it
!=
it_end
;
++
it
)
{
delete
it
->
second
->
cofunc
;
// delete cofunction
delete
it
->
second
;
// delete TOOL_STATE
delete
it
->
first
;
// delete the tool itself
}
}
void
TOOL_MANAGER
::
RegisterTool
(
TOOL_BASE
*
aTool
)
{
TOOL_STATE
*
st
=
new
TOOL_STATE
;
...
...
include/wxBasePcbFrame.h
View file @
d13355f7
...
...
@@ -95,8 +95,8 @@ protected:
/// main window.
wxAuiToolBar
*
m_auxiliaryToolBar
;
TOOL_MANAGER
*
m_toolManager
;
TOOL_DISPATCHER
*
m_toolDispatcher
;
TOOL_MANAGER
*
m_toolManager
;
TOOL_DISPATCHER
*
m_toolDispatcher
;
void
updateGridSelectBox
();
void
updateZoomSelectBox
();
...
...
include/wxPcbStruct.h
View file @
d13355f7
...
...
@@ -118,6 +118,7 @@ protected:
// to know the footprint name of components.
void
setupTools
();
void
destroyTools
();
void
onGenericCommand
(
wxCommandEvent
&
aEvent
);
// we'll use lower case function names for private member functions.
...
...
pcbnew/pcbframe.cpp
View file @
d13355f7
...
...
@@ -485,6 +485,7 @@ PCB_EDIT_FRAME::PCB_EDIT_FRAME( wxWindow* parent, const wxString& title,
PCB_EDIT_FRAME
::~
PCB_EDIT_FRAME
()
{
destroyTools
();
m_RecordingMacros
=
-
1
;
for
(
int
i
=
0
;
i
<
10
;
i
++
)
...
...
pcbnew/tools/pcb_tools.cpp
View file @
d13355f7
...
...
@@ -50,6 +50,13 @@ void PCB_EDIT_FRAME::setupTools()
}
void
PCB_EDIT_FRAME
::
destroyTools
()
{
delete
m_toolDispatcher
;
delete
m_toolManager
;
}
void
PCB_EDIT_FRAME
::
onGenericCommand
(
wxCommandEvent
&
aEvent
)
{
m_toolDispatcher
->
DispatchWxCommand
(
aEvent
);
...
...
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