Sorry, just found your original posting. Started the list from the top ;-)
So forget what I wrote before.

1.) your function BuildAnswerString create a chunk in the dynamic area so
you have to free it after you call QuestionEditRecord

2) With this code you just store strings in the database like "* *  ***".
The cast to your "questions_record_type" is definatly wrong with a string
like this. This is a string with some chars and a '\x00' at the end. But if
you read the from the DB and map it to your struct, the pointers do not
refer to a valid adress but to adress like '* * '. I think the way write and
read data does nit fit together.

Thomas

"meg" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
>
> I STILL can't get these memory leaks to go away.  For some reason, the
only
> way I can seem to save to the database is with a pointer to a pointer.
>
> error=DmWrite(p, offset,&newData, sizeof(char*));  where newData is a
char*.
>
> So I am only storing pointers, which are invalid once the program ends if
I
> free them, and create memory leaks when I don't free them.  But for some
> reason, I can't seem to store to the database the actual strings.  When I
> try
>
> error=DmWrite(p, offset,newData, StrLen(newData));
>
> None of the answers are actually stored in the database when I check
> later...
> any ideas?
> thank you!
>
>
>
>
>



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to