From: Vadim Zeitlin Date: Thu, 16 Dec 2004 10:24:37 +0000 (+0000) Subject: fix memory leak when using styes (closes 1086273) X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/97152f7856a81388163e883e340fa260f2719698 fix memory leak when using styes (closes 1086273) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31027 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/common/statbar.cpp b/src/common/statbar.cpp index 641a772927..0544a98b67 100644 --- a/src/common/statbar.cpp +++ b/src/common/statbar.cpp @@ -61,7 +61,7 @@ wxStatusBarBase::~wxStatusBarBase() { FreeWidths(); FreeStacks(); - InitStyles(); + FreeStyles(); // notify the frame that it doesn't have a status bar any longer to avoid // dangling pointers @@ -285,12 +285,12 @@ void wxStatusBarBase::InitStacks() void wxStatusBarBase::FreeStacks() { - if(!m_statusTextStacks) return; - size_t i; + if ( !m_statusTextStacks ) + return; - for(i = 0; i < (size_t)m_nFields; ++i) + for ( size_t i = 0; i < (size_t)m_nFields; ++i ) { - if(m_statusTextStacks[i]) + if ( m_statusTextStacks[i] ) { wxListString& t = *m_statusTextStacks[i]; WX_CLEAR_LIST(wxListString, t);