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)

This commit is contained in:
Kovid Goyal 2018-12-24 22:53:14 +05:30
parent 8d65b78abe
commit fdcd6d746c
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -73,6 +73,7 @@ if _speedup is not None:
def spell_property(sfmt, locale): def spell_property(sfmt, locale):
s = QTextCharFormat(sfmt) s = QTextCharFormat(sfmt)
s.setProperty(SPELL_LOCALE_PROPERTY, locale) s.setProperty(SPELL_LOCALE_PROPERTY, locale)
s.mem = locale # ensure locale is not garbage collected
return s return s
_speedup.init(spell_property, dictionaries.recognized, split_into_words_and_positions) _speedup.init(spell_property, dictionaries.recognized, split_into_words_and_positions)
del spell_property del spell_property