Re: GtkImageView




On Sun, 2008-01-06 at 19:59 +0100, Jeffrey Ratcliffe wrote:
On 05/01/2008, Emmanuele Bassi <ebassi gmail com> wrote:
try with:

  GdkRectangle_copy *

instead of GtkRectangle_ornull *.

That works, thanks for the help.

Why didn't it work before?

GdkRectangle_ornull will not copy the return value, but will just return
a pointer (plus safety check on NULL values); since the GdkRectangle is
put on the stack, this means that you'll get garbage as soon as you try
to access the pointer from outside the function.

GdkRectangle_copy will copy the stack allocated value into the heap,
thus giving back valid data (the memory will be deallocated when the
scalar gets garbage collected).

ciao,
 Emmanuele.

-- 
Emmanuele Bassi,
W: http://www.emmanuelebassi.net
B: http://log.emmanuelebassi.net




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