diff options
author | Aleksoid <aleksoid@users.sourceforge.net> | 2010-03-11 06:31:09 +0300 |
---|---|---|
committer | Aleksoid <aleksoid@users.sourceforge.net> | 2010-03-11 06:31:09 +0300 |
commit | 10e513058a3affd595c9eb3b95d7e59d48bb0785 (patch) | |
tree | 56173639ca33d75a7d8896ba29309012068afd49 /src/apps | |
parent | 50d1ad2b51a40453728511fc5ed2912bb58a5d15 (diff) |
fix : possible memory leak and debug build crash;
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@1749 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src/apps')
-rw-r--r-- | src/apps/mplayerc/VMROSD.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/apps/mplayerc/VMROSD.cpp b/src/apps/mplayerc/VMROSD.cpp index 26c88a93b..0fc6e4afe 100644 --- a/src/apps/mplayerc/VMROSD.cpp +++ b/src/apps/mplayerc/VMROSD.cpp @@ -402,6 +402,10 @@ void CVMROSD::DisplayMessage (OSD_MESSAGEPOS nPos, LPCTSTR strMsg, int nDuration if (m_FontSize<10 || m_FontSize>26) m_FontSize=20;
if (OSD_Font == _T("")) m_OSD_Font = AfxGetAppSettings().m_OSD_Font;
else m_OSD_Font = OSD_Font;
+
+ if(m_MainFont.GetSafeHandle())
+ m_MainFont.DeleteObject();
+
m_MainFont.CreatePointFont(m_FontSize*10, m_OSD_Font);
m_MemDC.SelectObject(m_MainFont);
@@ -411,6 +415,5 @@ void CVMROSD::DisplayMessage (OSD_MESSAGEPOS nPos, LPCTSTR strMsg, int nDuration if (nDuration != -1) SetTimer(m_pWnd->m_hWnd, (long)this, nDuration, (TIMERPROC)TimerFunc);
}
Invalidate();
- m_MainFont.DeleteObject();
}
}
|