Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Gtk3 Backend Source ID was not found #4164

Merged
merged 1 commit into from Feb 25, 2015

Conversation

zeroSteiner
Copy link
Contributor

I'm using matplotlib in a GTK3 application (backend is set to GTK3Cairo) and when my application exits I consistently get the following warning:

/usr/lib64/python2.7/site-packages/matplotlib/backends/backend_gtk3.py:215: Warning: Source ID 45 was not found when attempting to remove it
  GLib.source_remove(self._idle_event_id)

Looking into the issue it looks like the idle_event is removed and thus when GLib.source_remove is called, the event id no longer exists. It would be great if a check could take place before the event source is removed to determine if it is still valid.

This PR adds a reference to the Gtk3 source created by GLib.idle_add so it can be checked to see if it was destroyed later to avoid removing an invalid source id and causing the aforementioned warning messages to be displayed.

This adds a reference to the Gtk3 source created by
GLib.idle_add so it can be checked to see if it was
destroyed later to avoid removing an invalid source
id and causing warning messages to be displayed.
@tacaswell tacaswell added this to the next point release milestone Feb 25, 2015
@tacaswell
Copy link
Member

Seems reasonble to me @fariza any comment?

@fariza
Copy link
Member

fariza commented Feb 25, 2015

👍 I see no problem with this. Thanks for the fix

tacaswell added a commit that referenced this pull request Feb 25, 2015
Fix : Gtk3 Backend Source ID was not found
@tacaswell tacaswell merged commit 612b3f2 into matplotlib:master Feb 25, 2015
@tacaswell
Copy link
Member

Thanks! I wonder if this will also fix #3690

@zeroSteiner
Copy link
Contributor Author

Awesome, thank you both for the quick turnaround!

@tacaswell
Copy link
Member

erm, never mind on that other issue, that is WX, not gtk...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants