bug in Brew SDK? | developer.brewmp.com bug in Brew SDK? | developer.brewmp.com

Developer

bug in Brew SDK?

Forums:

in the applet, I declare a pointer. The data pointed by pointer is allocated some where. When I debug the program to :

boolean AEEApplet_HandleEvent(IApplet * po, AEEEvent evt, uint16 wParam,
uint32 dwParam)
{
return ((AEEApplet *)po)->pAppHandleEvent(po, evt,wParam,dwParam);

because this function is in AEEAppGen so I cannot debug contineuosly ( it showes only assembly code). But I discover a problem here:

Before calling the above function, my data (pointed by the pointer in applet) is correct. After the call, the data is changed.

I sure that my data is allocated correctly and is not de-allocated yet

What makes my code wrong? Or the data in the applet is not safe with pointers

Here is the code:

struct Something
{
int a;
int b;

struct LinkedList
{
void* pData;//pData will contain instances of struct Something
LinkedList;
LinkedList
declaration in Applet:
{
...
LinkedList *list;

Prototype:
AddNode(LinkedList**pList, void* pData, int lengthOfData);

Code:

Add a node to list:
Data data;
data.a = 1;
data.b = 2;

AddNode(*pList, &data, sizeof(Data));//pList is a pointer to LinkedList.

Does AddNode work properly with ?

Thanks in advance