Re: Still confused on new thread starting idle functions to update UI.



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]