On 03/11/2015 12:14 PM, Tim Waugh wrote:
>>From a quick glance, this looks wrong:
>
> ```
> /* If auto shutdown is active we have perhaps scheduled a timer to shut down
> due to not having queues any more to maintain, kill the timer now */
> if (autoshutdown && autoshutdown_exec_id &&
> cupsArrayCount(remote_printers) > 0) {
> debug_printf ("cups-browsed: New printers there to make available, killing auto shutdown timer.\n");
> g_source_destroy(g_main_context_find_source_by_id(NULL,
> autoshutdown_exec_id));
> autoshutdown_exec_id = 0;
> }
> ```
>
> Why are you calling g_source_destroy() rather than g_source_remove()?
>
I do not know why I have used "g_source_destroy()", perhaps seeing some
example somewhere on the internet.
What is the difference between "g_source_destroy()" and
"g_source_remove()"? Can I safely use "g_source_remove()" without
breaking something else? Or do I even have to use "g_source_remove()"
because the other is missing to do something important?
On 03/11/2015 12:14 PM, Tim Waugh wrote: exec_id && remote_ printers) > 0) { destroy( g_main_ context_ find_source_ by_id(NULL, exec_id) ); exec_id = 0;
>>From a quick glance, this looks wrong:
>
> ```
> /* If auto shutdown is active we have perhaps scheduled a timer to shut down
> due to not having queues any more to maintain, kill the timer now */
> if (autoshutdown && autoshutdown_
> cupsArrayCount(
> debug_printf ("cups-browsed: New printers there to make available, killing auto shutdown timer.\n");
> g_source_
> autoshutdown_
> autoshutdown_
> }
> ```
>
> Why are you calling g_source_destroy() rather than g_source_remove()?
>
I do not know why I have used "g_source_ destroy( )", perhaps seeing some
example somewhere on the internet.
What is the difference between "g_source_ destroy( )" and remove( )"? Can I safely use "g_source_remove()" without
"g_source_
breaking something else? Or do I even have to use "g_source_remove()"
because the other is missing to do something important?
Till