Re: Question about pixbuf




>>GdkPixbuf is a GObject, so the usual GObject API for
>>decreasing the
>>reference count will apply:
>>
>>  g_object_unref (pixbuf);
>>
>>if the reference count hit 0 then the pixbuf will be
>>disposed and all
>>its associated data will be released.
>>
>>ciao,
>> Emmanuele.

thanks for the answer.

but even I have question

when I use g_object_unref decreases reference count
and when this hit 0, the object is released, but when
does it  hit 0? when the program ends and eventually
released all memory or immediately that I used
g_object_unref?.

because apparently does not work because I have the
following

imgPixbuf = gdk_pixbuf_new_from_file(xfileName,
error);
...
g_object_unref (imgPixbuf);

but still I get data of pixbuf with: 

imgPixbuf = gdk_pixbuf_new_from_file(xfileName,
error);
...
g_object_unref (imgPixbuf);
width=gdk_pixbuf_get_width(imgPixbuf);

then the object is not destroyed



      ____________________________________________________________________________________
Yahoo! Deportes Beta
¡No te pierdas lo último sobre el torneo clausura 2008! Entérate aquí http://deportes.yahoo.com


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