diff options
-rw-r--r-- | doc/ScintillaHistory.html | 3 | ||||
-rw-r--r-- | win32/PlatWin.cxx | 7 |
2 files changed, 7 insertions, 3 deletions
diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html index a6e618e82..18179c735 100644 --- a/doc/ScintillaHistory.html +++ b/doc/ScintillaHistory.html @@ -568,6 +568,9 @@ Cursor no longer flickers in edit and combo boxes. Focus in and out events occur for combo boxes. </li> + <li> + Fix a leak in the bidirectional code on Win32. + </li> </ul> <h3> <a href="https://www.scintilla.org/scite410.zip">Release 4.1.0</a> diff --git a/win32/PlatWin.cxx b/win32/PlatWin.cxx index 9e03dec16..222eac26b 100644 --- a/win32/PlatWin.cxx +++ b/win32/PlatWin.cxx @@ -1844,6 +1844,10 @@ ScreenLineLayout::ScreenLineLayout(const IScreenLine *screenLine) { } ScreenLineLayout::~ScreenLineLayout() { + if (textLayout) { + textLayout->Release(); + textLayout = nullptr; + } } // Get the position from the provided x @@ -1888,7 +1892,6 @@ size_t ScreenLineLayout::PositionFromX(XYPOSITION xDistance, bool charPosition) ); } - textLayout->Release(); size_t pos; if (charPosition) { pos = isTrailingHit ? hitTestMetrics.textPosition : caretMetrics.textPosition; @@ -1921,8 +1924,6 @@ XYPOSITION ScreenLineLayout::XFromPosition(size_t caretPosition) { &caretMetrics ); - textLayout->Release(); - return pt.x; } |