Skip to content

gdbusconnection: Explicitly destroy an idle source on cleanup

Philip Withnall requested to merge pwithnall/glib:2925-gdbus-threading-test into main

Otherwise it’s possible for it to hang around in the GMainContext after the “send message” operation has finished. In the best case, this will cause the GTask and GDBusMessage to not be freed when the calling code expects. In the worst case, it could cause use-after-free problems if it derefs allocations which have since been freed.

I have not seen either of these problems in practice, but it would be best for the code to eliminate the risk of them altogether by explicitly destroying the source when the operation is finished.

Signed-off-by: Philip Withnall

Helps: #2925

Merge request reports