Re: problem: gtk_image gives critical error



When I print the address of p in the funcl it prints a

address.
In the callback function it also prints the same for ptr.
Then what's the problem.

Whether the address keeps the same or not, it points
to an invalid position in memory. This is quite basic C skill.

Also I use structures to pass data all the time to
the callback function then there's no error but with
this image widget there seems any problem.

That's ok as long as the structure is not created on stack
of returning functions.

Please clarify if I have any alternatives

Use g_new() to malloc the stucture on heap.


Cheers,
Andy



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