Skip to content

Commit

Permalink
Merge pull request #4164 from zeroSteiner/gtk3-source-ref
Browse files Browse the repository at this point in the history
Fix : Gtk3 Backend Source ID was not found
  • Loading branch information
tacaswell committed Feb 25, 2015
2 parents 9edca5f + 5467c98 commit 612b3f2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/matplotlib/backends/backend_gtk3.py
Expand Up @@ -208,11 +208,14 @@ def __init__(self, figure):
self.set_can_focus(True)
self._renderer_init()
self._idle_event_id = GLib.idle_add(self.idle_event)
default_context = GLib.main_context_get_thread_default() or GLib.main_context_default()
self._idle_event_source = default_context.find_source_by_id(self._idle_event_id)

def destroy(self):
#Gtk.DrawingArea.destroy(self)
self.close_event()
GLib.source_remove(self._idle_event_id)
if not self._idle_event_source.is_destroyed():
GLib.source_remove(self._idle_event_id)
if self._idle_draw_id != 0:
GLib.source_remove(self._idle_draw_id)

Expand Down

0 comments on commit 612b3f2

Please sign in to comment.