Re: g_timer:assertion `timer != NULL' failed ?

xiangbing <xb_parasite tom com> writes:

Hi Xiang,

>   GTimer  * timer;
>   g_timer_start (timer) ;

You may not pass NULL to g_timer_start, not to mention wild pointers.
Instead, you must call g_timer_new to create a GTimer.  So the above
code should look like this:

  GTimer *timer = g_timer_new ();

You don't even have to call g_timer_start, because it turns out
g_timer_new will automatically start the timer for you.

All this and more is covered in the GLib Reference Manual[1], section
GLib Utilities, Timers[2].

Hope this helps,

Daniel Brockman
drlion deepwood net


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