Re: Timer start registration breaks the gtk_main()
- From: Robert Pearce <rob bdt-home demon co uk>
- To: ikorot earthlink net
- Cc: gtk-list gnome org
- Subject: Re: Timer start registration breaks the gtk_main()
- Date: Sun, 27 Mar 2011 08:30:27 +0100
Hi ikorot earthlink net,
On Sat, 26 Mar 2011 20:45:53 -0700 (GMT-07:00) you wrote:
> >
> >Yes. You are casting the _RESULT_ of a _CALL_ to ReadData into a GSourceFunc, but ReadData returns void. This produces utterly random results.
>
> Yes, I believe I made a mistake here. I was not in front of my developmental machine,
> so...
> I think the ReadData() is returning gboolean.
Perhaps, but a gboolean is most definitely not the same as a
GSourceFunc. So I shall reiterate:
> >> g_timer_add_seconds( 1, (GSourceFunc) frame->ReadData(), NULL );
^^
You are casting the _RESULT_ of a _CALL_ to ReadData into a
GSourceFunc, but ReadData returns bool. This produces guaranteed
illegal results.
The second argument of g_timeout_add_seconds is a function pointer, and
requires that you pass it a simple C function reference _without_ the
call syntax.
Unless you're now going to say that you'd misremembered that too, and
the actual code doesn't have the () after the frame->ReadData in the
line I re-quoted. It would really help us to help you if you had posted
your actual code rather than a misremembered vague approximation.
Cheers,
Rob
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]