Core with PtLabel of IMAGE type

Hi all,

I’m trying to swap between 3 images through a radio button selector. To
perform this without copying all the image, I set the image argument of my
PtLabel widget. After some swaps, application cores. Why? Is there any
trouble in changing the image more than once?
I’m using QNX 6 with PhAB.

Hello Christopher

Are you freeing the image data after copying it to the image? You can free
the PhImage_t structure but you can’t free the data of the image. Also
if you are loading these images from a data base, you can’t close the
data base until you are done with the images. If you are not doing either
of these things could you please post the code that you are using to set the
images?

Thanks,
Rodney


Christophe Guerber <guerber@worldnet.fr> wrote:

Hi all,

I’m trying to swap between 3 images through a radio button selector. To
perform this without copying all the image, I set the image argument of my
PtLabel widget. After some swaps, application cores. Why? Is there any
trouble in changing the image more than once?
I’m using QNX 6 with PhAB.

Never mind!
I think I’ve found what’s wrong: When I set the resource, it frees the old
image buffer. I keep a pointer to this PtImage and when I set the resource
for the second time the image buffer has been freed… And it cores!

Gui Group <gui@qnx.com> a écrit dans le message :
9ts3ri$okr$1@nntp.qnx.com

Hello Christopher

Are you freeing the image data after copying it to the image? You can
free
the PhImage_t structure but you can’t free the data of the image. Also
if you are loading these images from a data base, you can’t close the
data base until you are done with the images. If you are not doing either
of these things could you please post the code that you are using to set
the
images?

Thanks,
Rodney


Christophe Guerber <> guerber@worldnet.fr> > wrote:
Hi all,

I’m trying to swap between 3 images through a radio button selector. To
perform this without copying all the image, I set the image argument of
my
PtLabel widget. After some swaps, application cores. Why? Is there any
trouble in changing the image more than once?
I’m using QNX 6 with PhAB.

Hello Christopher

That’s exactly right. Glad you found the problem.

Rodney


Christophe Guerber <guerber@worldnet.fr> wrote:

Never mind!
I think I’ve found what’s wrong: When I set the resource, it frees the old
image buffer. I keep a pointer to this PtImage and when I set the resource
for the second time the image buffer has been freed… And it cores!

Gui Group <> gui@qnx.com> > a écrit dans le message :
9ts3ri$okr$> 1@nntp.qnx.com> …
Hello Christopher

Are you freeing the image data after copying it to the image? You can
free
the PhImage_t structure but you can’t free the data of the image. Also
if you are loading these images from a data base, you can’t close the
data base until you are done with the images. If you are not doing either
of these things could you please post the code that you are using to set
the
images?

Thanks,
Rodney


Christophe Guerber <> guerber@worldnet.fr> > wrote:
Hi all,

I’m trying to swap between 3 images through a radio button selector. To
perform this without copying all the image, I set the image argument of
my
PtLabel widget. After some swaps, application cores. Why? Is there any
trouble in changing the image more than once?
I’m using QNX 6 with PhAB.