Avoid possible IdleWork() calls on destructed ScintillaGTK objects.
The idle callback removal clause in the ScintillaGTK destructor got broken in [code:4e5c321dda8e69104cb7b639c3107dc11dbc00f6], leading to the callback not being removed thus possibly running after the instance destruction.
Indeed, gdk_threads_add_idle() wraps g_idle_add() with a custom user data, thus making the g_source_remove_by_user_data() call in the destructor incorrect, as we give it our own user data, not GDK's wrapper one.
Fix the callback removal not to use user data matching to avoid this.
Attached are 3 possible implementations of a fix:
WorkNeeded::active to an IdlerID so the GTK platform can use it as such. No other platform seem to use WorkNeeded::active.WorkNeeded::active and adds a private member to ScintillaGTK with the same purpose. Again, no other platform seem to use WorkNeeded::active, hence the removal.WorkNeeded::active removal.
The other core platform that uses a high-priority idle for styling is Cocoa. Adding styleIdleID is more similar to Cocoa and uses GTK+ types avoiding casts so this was the alternative I preferred. Removing active could potentially break other platforms but it wasn't used by Cocoa so appears fairly safe.
Committed alternative 2 as [d88920].
Related
Commit: [d88920]