Re: Gtk+ and multithreating
- From: Michael L Torrie <torriem chem byu edu>
- To: gtk-app-devel-list gnome org
- Subject: Re: Gtk+ and multithreating
- Date: Wed, 16 May 2007 17:01:07 -0600
On Wed, 2007-05-16 at 23:22 +0100, Chris Vine wrote:
And you would need to put the "Hello" argument on the heap, and free it
in the wrapper function, because otherwise it will go out of scope
before the idle handler is called. (Sigh). Use g_strdup() to create the
string on the heap. Simple examples are never that simple.
On this case, "Hello" is a statically allocated string. It's always
available and never is destroyed (it is always on the heap, as it were).
Not something that's typically useful, though. In general, yes, data
must be allocated on the heap, not the stack, in order to be passed to a
callback handler like this. Unless it's a global static object (such as
a string literal).
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
] [Thread Prev