Problems freeing memory after PxLoadImage()

I’m having some problems freeing memory after load an image from file with PxLoadImage().

I tried

PhImage_t * image = NULL;

image = PxLoadImage ( “/tmp/image.png”, NULL );

– Set image to PtLabel (Pt_ARG_LABEL_DATA)

PhReleaseImage( image );
free ( image );

But it doesn’t work well for me. There is still allocated memory after.

What’s missing?


How can you tell memory is still allocated, what version of NTO are you using?

As stated in the documentation you are missing image->flags |= Ph_RELEASE_IMAGE_ALL;


mario… thanks for the answer, and sorry for the delay in my reply but it works fine, the thing is that I was facing other problem with PxLoadImage() that fried my brain.

After a week of debuging a SIGSEGV in some point of the code (after PxLoadImage) we realize that it seems that Photon can’t manage well PNG files with transparencies. It was not the first logical cause of the segment violation because we have a lot of new code and we though that the problem was there… But it seems is not the case. At last, we tried with no transparencies or other format images (bmp, jpg) and we build some test application that loads and frees images (with PxLoadImage) every 50 msec and we let it running for a whole day. No problems. That’s the story.

Does anybody knows if this is a documented issue?

Regards and thank you again,