From cbe718276c8e78c5552e4c598361dab690549a7f Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Fri, 30 Jul 2004 23:57:48 +0000 Subject: Fixed bitmap leaks from system caret patch. --- win32/ScintillaWin.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'win32') diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx index b3afb4d5a..be21fa4d5 100644 --- a/win32/ScintillaWin.cxx +++ b/win32/ScintillaWin.cxx @@ -306,6 +306,7 @@ void ScintillaWin::Finalise() { ScintillaBase::Finalise(); SetTicking(false); SetIdle(false); + DestroySystemCaret(); ::RevokeDragDrop(MainHWND()); ::OleUninitialize(); } @@ -765,6 +766,7 @@ sptr_t ScintillaWin::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam case WM_SETFOCUS: SetFocusState(true); RealizeWindowPalette(false); + DestroySystemCaret(); CreateSystemCaret(); break; @@ -2147,7 +2149,10 @@ BOOL ScintillaWin::CreateSystemCaret() { BOOL ScintillaWin::DestroySystemCaret() { ::HideCaret(MainHWND()); BOOL retval = ::DestroyCaret(); - ::DeleteObject(sysCaretBitmap); + if (sysCaretBitmap) { + ::DeleteObject(sysCaretBitmap); + sysCaretBitmap = 0; + } return retval; } -- cgit v1.2.3