Subject: Crash if I click button twice
From: "druid" <[EMAIL PROTECTED]>
Date: Mon, 18 Jul 2005 23:34:10 -0000
this code will crash If I click the save button twice
I must not be releasing some memory somewhere
The almost complete absence of error checking in your code denies you the
ability to know which part of the code is failing and also permits the
function to continue even after it has hit a major error. If you had error
checking, then you'd know this line is where the function is failing second
time through:
h = DmNewRecord(dbPtr, &index, size);
You have a key variable undefined, specifically 'dbPtr', which it implies
it is a global variable.
At the end of your function, if all goes well, 'dbPtr' will be non-NULL and
pointing at a closed database, causing the line noted above to fail the
second time the function is executed.
Also if you'd have stepped through the code using the debugger you should
also have caught this line of code.
Roger Stringer
Marietta Systems, Inc. (www.rf-tp.com)
--
For information on using the PalmSource Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/