Remove unnecessary wxStaticBitmap::DeleteCurrentHandleIfNeeded()
This function was used exactly once and it's simpler and more clear to just inline it into Free() where it was called. No real changes, this is just a small simplification.
This commit is contained in:
@@ -90,9 +90,6 @@ private:
|
|||||||
// HICON (which can be 0) and destroy the previous image if necessary.
|
// HICON (which can be 0) and destroy the previous image if necessary.
|
||||||
void MSWReplaceImageHandle(WXLPARAM handle);
|
void MSWReplaceImageHandle(WXLPARAM handle);
|
||||||
|
|
||||||
// Delete the current handle only if we own it.
|
|
||||||
void DeleteCurrentHandleIfNeeded();
|
|
||||||
|
|
||||||
|
|
||||||
wxDECLARE_DYNAMIC_CLASS(wxStaticBitmap);
|
wxDECLARE_DYNAMIC_CLASS(wxStaticBitmap);
|
||||||
wxDECLARE_EVENT_TABLE();
|
wxDECLARE_EVENT_TABLE();
|
||||||
|
@@ -191,20 +191,15 @@ void wxStaticBitmap::Init()
|
|||||||
m_ownsCurrentHandle = false;
|
m_ownsCurrentHandle = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxStaticBitmap::DeleteCurrentHandleIfNeeded()
|
void wxStaticBitmap::Free()
|
||||||
{
|
{
|
||||||
|
MSWReplaceImageHandle(0);
|
||||||
|
|
||||||
if ( m_ownsCurrentHandle )
|
if ( m_ownsCurrentHandle )
|
||||||
{
|
{
|
||||||
::DeleteObject(m_currentHandle);
|
::DeleteObject(m_currentHandle);
|
||||||
m_ownsCurrentHandle = false;
|
m_ownsCurrentHandle = false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void wxStaticBitmap::Free()
|
|
||||||
{
|
|
||||||
MSWReplaceImageHandle(0);
|
|
||||||
|
|
||||||
DeleteCurrentHandleIfNeeded();
|
|
||||||
|
|
||||||
wxDELETE(m_image);
|
wxDELETE(m_image);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user