Re: Two documentations details (sources IDs, interruptions)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Nicolas George wrote:
[...]
Is it safe to assume that sources IDs returned by g_source_attach or derived
functions are never 0?

  As far as I can see in the source, it is safe until a 32-bits integer
  overflow. The reason to want to know it is to be able to pack the
  information 'I have set up a timeout' along with the source ID necessary
  to cancel it.

I always write this type of code:

    if (id > 0)
        g_source_remove (...);
    id = g_timeout_add (...);

But I cant say whether it is common practice, acceptable or
advisable; personally I've made the assumption that its the
way to go :-/

Cheers,
                        -Tristan
_______________________________________________

gtk-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gtk-list

[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux