Forums | developer.brewmp.com Forums | developer.brewmp.com

Developer

Forums

Forums:

Hello guys,

I have a problem which is like :;

I have downloaded a image from say any server and stored it in byte pointer,

Now i am passing this byte pointer to IMEMASTREAM_Set function and then later on displaying the image,

Afterwards when my work is done, i release the IMEMASTREAM object using the relaease function in the API

But now when i go release the byte pointer into which i kept the data intially, it gives a crash saying "User BreakPoint something" and the application crashes
when i debugged it shows when i release the IMEMSTREAM object, the data which in the byte pointer changes to constant special characters.

If i do not free the byte pointer then my application gives a memory leak.

Can somebody tell me how should i exactly free the intial data downloaded from the server.

From API reference:
The responsibility of freeing the buffer pBuff lies with the IMemAStream Interface. Do not free this buffer. It is freed when either of the following two actions occur:
The IMemAStream Interface object is released using IMEMASTREAM_Release().
A subsequent call to IMEMASTREAM_Set() is attempted with another buffer.
If a buffer has already been set into the stream using a previous call to this function, that buffer is freed before setting the new buffer.

From API reference:
The responsibility of freeing the buffer pBuff lies with the IMemAStream Interface. Do not free this buffer. It is freed when either of the following two actions occur:
The IMemAStream Interface object is released using IMEMASTREAM_Release().
A subsequent call to IMEMASTREAM_Set() is attempted with another buffer.
If a buffer has already been set into the stream using a previous call to this function, that buffer is freed before setting the new buffer.

Thanks for the reply dost, but i am still getting memory leak problem
any Suggestions for how to find a memory leak efficiently,
I have tried following methods ::
i have searched the whole project for all the malloc which i have used and cross checked that whether they all are freed or not.
Any other mistake if i am making.
My whole project is done, but only this last memory leak is not getting solved, i have tried to test the project on a handset and it's working fine there.
But i don't want to take any chances.

Thanks for the reply dost, but i am still getting memory leak problem
any Suggestions for how to find a memory leak efficiently,
I have tried following methods ::
i have searched the whole project for all the malloc which i have used and cross checked that whether they all are freed or not.
Any other mistake if i am making.
My whole project is done, but only this last memory leak is not getting solved, i have tried to test the project on a handset and it's working fine there.
But i don't want to take any chances.

some memory leaks may be found in simulator output logs.
If there is a MALLOC that was not FREEed, you would get a statement:-
- the file name & line no of leak is printed as below:-
*AEEHeap.c:1167 - 1000 - mysms #4900 c:\program files\brew315\sdk\examples\mysms\mysms.cpp:488 (L)
If a createInstance is not Release-ed:-
- in this case you may get a hint-
*AEEHeap.c:1167 - 70 - mysms #4693 \p4c\brew-dev3x-automated-build\brewery\pk\lib\src\aee\AEEMenu.c:4458 (L)
this may mean that IMenuCtl was not Released.
thanks.

some memory leaks may be found in simulator output logs.
If there is a MALLOC that was not FREEed, you would get a statement:-
- the file name & line no of leak is printed as below:-
*AEEHeap.c:1167 - 1000 - mysms #4900 c:\program files\brew315\sdk\examples\mysms\mysms.cpp:488 (L)
If a createInstance is not Release-ed:-
- in this case you may get a hint-
*AEEHeap.c:1167 - 70 - mysms #4693 \p4c\brew-dev3x-automated-build\brewery\pk\lib\src\aee\AEEMenu.c:4458 (L)
this may mean that IMenuCtl was not Released.
thanks.