aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2021-03-19 10:00:47 +1100
committerNeil <nyamatongwe@gmail.com>2021-03-19 10:00:47 +1100
commit4c086ac7bebe13bcd2146f4e2cebc40510a7223c (patch)
tree2d1c8b4a15462f056588fd4033a304b2d291feaa
parentf1d2180c18c0005a5f0f326515e3b4134e277258 (diff)
downloadscintilla-mirror-4c086ac7bebe13bcd2146f4e2cebc40510a7223c.tar.gz
Protect against exceptions from ILexer5::Release as called inside destructor.
-rw-r--r--src/ScintillaBase.cxx12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/ScintillaBase.cxx b/src/ScintillaBase.cxx
index 93c41d3d9..1e55fcfbf 100644
--- a/src/ScintillaBase.cxx
+++ b/src/ScintillaBase.cxx
@@ -584,14 +584,22 @@ LexState::LexState(Document *pdoc_) noexcept : LexInterface(pdoc_) {
LexState::~LexState() {
if (instance) {
- instance->Release();
+ try {
+ instance->Release();
+ } catch (...) {
+ // ILexer5::Release must not throw, ignore if it does.
+ }
instance = nullptr;
}
}
void LexState::SetInstance(ILexer5 *instance_) {
if (instance) {
- instance->Release();
+ try {
+ instance->Release();
+ } catch (...) {
+ // ILexer5::Release must not throw, ignore if it does.
+ }
instance = nullptr;
}
instance = instance_;