Fixed a problem in the demo and plugged a potential leak in SetDashes

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12493 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2001-11-19 20:43:04 +00:00
parent 08da19d737
commit 05f30eecb7
3 changed files with 17 additions and 7 deletions

View File

@@ -190,13 +190,16 @@ public:
{ m_dash = NULL; }
~wxPyPen() {
if (m_dash)
delete m_dash;
delete [] m_dash;
}
void SetDashes(int nb_dashes, const wxDash *dash) {
if (m_dash)
delete [] m_dash;
m_dash = new wxDash[nb_dashes];
for (int i=0; i<nb_dashes; i++)
for (int i=0; i<nb_dashes; i++) {
m_dash[i] = dash[i];
}
wxPen::SetDashes(nb_dashes, m_dash);
}