I originally thought that this problem was brought about by the compiler I was using, because at work I was using CodeWarrior for PalmOS 8.0 and at home I was using CodeWarrior for PalmOS 9.0.
Probably not your compiler.
The SAME code would compile and work correctly from home, but would generate the memory error if it was compiled at work.
I would guess you were just getting lucky at home.
The error (MemoryMgr.c, Line4365, NULL handle) is generated during this function, on line 7:
Which is line 7? It's hard to say what's wrong, but I'll give a couple guesses.
If you're getting the error on the MemHandleLock(), you may consider checking for passH == 0 before trying to lock it.static Boolean SetPassword(void) { Boolean retval; MemPtr password; MemHandle passH;
passH = MemHandleNew(12);
password = MemHandleLock(passH);
This line looks questionable. First you set password to a new locked handle, then you set it = GetField(). What does GetField() do?
password = GetField(MainForm, MainTxtPasswordField);
if (password == NULL) retval = false; else if (StrLen(password) < 4) retval = false; else { StrCopy(g_prefs.MyPass, password); retval = true; }
MemHandleUnlock(passH); MemHandleFree(passH);
return retval; }
-- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
