Philipp Hörist pushed to branch master at gajim / gajim
Commits: 4ac532c3 by Philipp Hörist at 2019-04-08T20:45:26Z Fix memory leak with spell checker
- Dont shadow widgets destroy() - Dont bind spell checker to class attribute, this prevents its finalize
Fixes #8822
- - - - -
2 changed files:
- gajim/chat_control_base.py - gajim/message_textview.py
Changes:
===================================== gajim/chat_control_base.py ===================================== @@ -323,7 +323,6 @@ class ChatControlBase(MessageControl, ChatCommandProcessor, CommandTools): self.set_emoticon_popover()
# Attach speller - self.spell_checker = None self.set_speller() self.conv_textview.tv.show()
@@ -454,15 +453,15 @@ class ChatControlBase(MessageControl, ChatCommandProcessor, CommandTools): if gspell_lang is None: return
- self.spell_checker = Gspell.Checker.new(gspell_lang) + spell_checker = Gspell.Checker.new(gspell_lang) spell_buffer = Gspell.TextBuffer.get_from_gtk_text_buffer( self.msg_textview.get_buffer()) - spell_buffer.set_spell_checker(self.spell_checker) + spell_buffer.set_spell_checker(spell_checker) spell_view = Gspell.TextView.get_from_gtk_text_view(self.msg_textview) spell_view.set_inline_spell_checking(False) spell_view.set_enable_language_menu(True)
- self.spell_checker.connect('notify::language', self.on_language_changed) + spell_checker.connect('notify::language', self.on_language_changed)
def get_speller_language(self): per_type = 'contacts'
===================================== gajim/message_textview.py ===================================== @@ -17,8 +17,6 @@ # You should have received a copy of the GNU General Public License # along with Gajim. If not, see http://www.gnu.org/licenses/.
-import gc - from gi.repository import Gtk from gi.repository import GLib from gi.repository import GObject @@ -413,9 +411,6 @@ class MessageTextView(Gtk.TextView): self.add_child_at_anchor(image, anchor) buffer_.insert_at_cursor(' ')
- def destroy(self): - GLib.idle_add(gc.collect) - def clear(self, widget=None): """ Clear text in the textview
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/4ac532c3fa5d9e6ca8f558e4270b2138f9a...