From fdcd6d746ca5732f783023c82a6e18841ee57c40 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 24 Dec 2018 22:53:14 +0530 Subject: [PATCH] macOS: Fix for random srashes when using the edit book tool on Mojave. Fixes #1805521 [e-book edit (3.34.0) repeatedly crashes when editing an epub file](https://bugs.launchpad.net/calibre/+bug/1805521) --- src/calibre/gui2/tweak_book/editor/syntax/html.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/calibre/gui2/tweak_book/editor/syntax/html.py b/src/calibre/gui2/tweak_book/editor/syntax/html.py index e0296dd5e3..96ce24940e 100644 --- a/src/calibre/gui2/tweak_book/editor/syntax/html.py +++ b/src/calibre/gui2/tweak_book/editor/syntax/html.py @@ -73,6 +73,7 @@ if _speedup is not None: def spell_property(sfmt, locale): s = QTextCharFormat(sfmt) s.setProperty(SPELL_LOCALE_PROPERTY, locale) + s.mem = locale # ensure locale is not garbage collected return s _speedup.init(spell_property, dictionaries.recognized, split_into_words_and_positions) del spell_property