DestroyWindow,DeleteObject 之前需要判断对象是否为NULL吗?之后需要将对象置NULL吗?比如:
if (m_hFont != NULL)
{
::DeleteObject(m_hFont);
m_hFont = NULL;
}
好,还是直接:
::DeleteObject(m_hFont);
好?
if (m_hFont != NULL)
{
::DeleteObject(m_hFont);
m_hFont = NULL;
}
好,还是直接:
::DeleteObject(m_hFont);
好?
{
::DeleteObject(m_hFont);
}
{
::DeleteObject(m_hFont);
m_hFont = NULL;
}
不会有野指针
{
::DeleteObject(m_hFont);
m_hFont = NULL;
}
好
{
::DeleteObject(m_hFont);
m_hFont = NULL;
}
彻底