GLibSharp / GtkSharp

.Net bindings for gtk+3 and above
Other
27 stars 21 forks source link

Prevent double removal of timeout sources #49

Closed xhaakon closed 3 years ago

xhaakon commented 4 years ago

When a timeout source is scheduled for removal by returning false from its handler, doing just Remove() on SourceProxy is not enough, because it doesn't prevent g_source_remove() from eventually getting called from SourceProxy's finalizer, effectively removing the same Source ID twice.

Replacing Remove() with Dispose() fixes the double removal and the accompanying "Source ID XX was not found when attempting to remove it" GLib critical.

ylatuya commented 3 years ago

I'd love to have this PR merged too. The patch looks good to me. Can you review it @thiblahute?