Re: Still confused on new thread starting idle functions to update UI.
- From: Chris Angelico <rosuav gmail com>
- Cc: gtk-app-devel-list list <gtk-app-devel-list gnome org>
- Subject: Re: Still confused on new thread starting idle functions to update UI.
- Date: Thu, 5 Dec 2013 02:38:59 +1100
On Thu, Dec 5, 2013 at 2:18 AM, David Buchan <pdbuchan yahoo com> wrote:
What I mean is, is it kosher to have:
msgdatas msgdata; // I'd pass &msgdata as arg. to g_idle_add() I suppose.
No, it's most definitely not, unless you can guarantee that (a) the
function that called this will still be running when the idle function
is called, and (b) it won't have reused the structure for the next
message. I don't think you can, which means you MUST allocate this
structure on the heap as well. But see my other post; you might well
not need to pass the textview pointer around.
ChrisA
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]