Hello meg,

actually there is nothing in these 2 lines that could cause memory leaks.
You should provide us with some more code to detect them and to find out,
why the content of newData is not stored in your database. But what I can
see from the 2 lines:
The first is not the way you would use a database.
The second looks much better, but you probably should write
StrLen(newData)+1 if you also want to store the '\x00' at the of the string.
If you dont save the length of string somewhere else and just read from this
record, you might get garbage at its end. But give us some more code to be
more specific.

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