Dear all,

I am not sure about the danger of my program, could anyone please help
me?

Suppose,
// dbRef is the database with 100 records, each of size 15k
for (i=0;i<100;i++)
    {
    recordH=DmQueryRecord(dbRef,i);
    recordPtr=MemHandleLock(recordH);
    myPtr[i]=(CharPtr)recordPtr;
    MemHandleUnlock(recordH);
    }

Is it very unsafe to access myPtr after this FOR loop? Is the answer of
this question depends on whether I would have to create new record or
increasing the size of record after this FOR loop? OR, is the answer of
the question depends on whether I have plenty of free storage heap
memory or not?

I think I would just leave MemHandleUnlock to happen when I exit my
application. Am I correct?

Thank you very much!

philip


Reply via email to