Suppressed double hiding/deletion of caret which can cause the caret to go missing from a different window that's currently focused

This commit is contained in:
JulianSmart
2015-09-28 14:18:34 +01:00
parent 40430585d6
commit 965786a0fa

View File

@@ -705,13 +705,18 @@ bool ScintillaWX::CreateSystemCaret() {
bool ScintillaWX::DestroySystemCaret() {
#ifdef __WXMSW__
::HideCaret(GetHwndOf(stc));
BOOL retval = ::DestroyCaret();
if (sysCaretBitmap) {
::DeleteObject(sysCaretBitmap);
sysCaretBitmap = 0;
if (sysCaretBitmap)
{
::HideCaret(GetHwndOf(stc));
BOOL retval = ::DestroyCaret();
if (sysCaretBitmap) {
::DeleteObject(sysCaretBitmap);
sysCaretBitmap = 0;
}
return retval != 0;
}
return retval != 0;
else
return false;
#else
return false;
#endif