Oddly, if the function “g_initable_init” is commented out, there will be no leakage. The memory requested by the corresponding polkit_authority_initable_init in the polkit code is also released in the finalize function invoked during unref.
Right, sleep() won’t iterate the main context, just block.
To be clear, what is likely happening is that work is being done off the main thread, but because the program never releases control to a running GMainLoop or iterates the GMainContext manually those tasks are never allowed resolve.
There is an example in the repository linked above showing use of a GMainLoop to iterate the GMainContext.