aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2004-07-30 23:57:48 +0000
committernyamatongwe <devnull@localhost>2004-07-30 23:57:48 +0000
commitba784d857d61212356c8dee1f31159ceb6c2f966 (patch)
treeedb2de9b1bfbd9ba9e60efe8e92b4cdb69041578
parent86254bbfaacc5eda147d4defee3acf794deb7a62 (diff)
downloadscintilla-mirror-ba784d857d61212356c8dee1f31159ceb6c2f966.tar.gz
Fixed bitmap leaks from system caret patch.
-rw-r--r--win32/ScintillaWin.cxx7
1 files changed, 6 insertions, 1 deletions
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;
}