I've got this down to the simplest case and hopefully someone knows
something about this. What I'm doing is populating a form with controls
based on settings in a database. The whole thing falls apart with
successfully creating and destroying the controls when I allocate other
memory structures. The problem is easy to duplicate just add the following
code to a standard Palm OS Application Stationery (C++ application):
static MemHandle TestHandle;
static void MainFormInit(FormPtr frmP)
{
FormLabelType *NewForm;
TestHandle = MemHandleNew(10);
NewForm= FrmNewLabel (&frmP,2000, "Test Label", 20, 20,stdFont);
}
// MainFormHandleEvent
...
case frmCloseEvent:
UInt16 obj1NDX;
frmP = FrmGetActiveForm();
obj1NDX=FrmGetObjectIndex(frmP,2000);
if (obj1NDX != frmInvalidObjectId)
{
error=FrmRemoveObject (&frmP,obj1NDX);
}
MemHandleFree(TestHandle);
break;
...
-------------------------------------------------------------
The first time you run this you will get a label displayed. If you then
exit the program (hit the home icon) and execute it a second time the system
will reboot. Commenting out the memory allocation/deallocation corrects
this problem, but I need to be able to allocate memory. Anyone have any
ideas? If not how do I notify Palm without paying for an incident (this is
obviously a bug on thier part).
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/