Multiple callbacks posible with GtkSourceSearchContext async API
I was prototyping some new code in Builder using GtkSourceSearchContext and I noticed some strange assertions in my code when passing a GCancellable
to gtk_source_search_context_backward_async()
. In particular, I was getting multiple callbacks to my GAsyncReadyCallback
upon GCancellable::cancelled
. That makes it impossible to get reference counting right for the async closure state. I don't think GTask
gives any protection against the case of calling g_task_return_error()
multiple times (arguably it should).
I haven't had a chance to debug why, but thought I'd file this first in case it's something obvious.
Using NULL
for the cancellable parameter avoids the issue for me.