timer reference count differs when removing a timer with G_SOURCE_REMOVE or g_source_remove
If a timer (created and started with g_timeout_source_new, g_source_set_callback and g_source_attach) ends by returning G_SOURCE_REMOVE from the callback function the GDestroyNotify function is called with a timer reference count of 3 (+1 for timer itself, +1 for timeout callback, +1 for attachment to main context).
If a timer (created and started with g_timeout_source_new, g_source_set_callback and g_source_attach) ends by stopping it with g_source_remove the callback function the GDestroyNotify function is called with a timer reference count of 2 (+1 for timer itself, +1 for attachment to main context).
This is confusing regarding whether to call g_source_unref in the GDestroyNotify function. It looks like g_source_unref is not necessary in both cases, but I'm not sure and this is not clear from the documentation.
I'll attach a simple case that shows the issue. The question is: is line 40 needed, in other words: is it needed to do g_source_unref in the "G_SOURCE_REMOVE" case? and, if no, where is this documented?
Btw. the use-case is a dynamic repetitive adaptive timer. The timer needs to be restarted (with possibly a new interval) since it is repetitive and adaptive. In other cases the timer needs to be stopped and restarted (e.g. due to external/other states).