At 19:09 2002-10-29 -0800, you wrote:
After calling VFSFileDBGetResource(), the documentation states that I should free the handle returned in the resHP argument using MemHandleFree().

However, the documentation for this function says that the handle is allocated in the _storage_ heap, which would imply it was allocated behind the scenes through the Data Manager, and should probably be deallocated using DmReleaseResource(). As I recall, one uses MemHandleFree() only on handles allocated in the dynamic heap.

Furthermore, MemHandleDataStorage( resHP ) returns true, confirming that resHP was allocated in the storage heap.

Is this a documentation bug, or am I missing something?
DmNewHandle allocates new chunks on the storage heap that aren't necessarily associated with any database. I would guess that the VFSFileDBGetResource call uses this. The correct way to free this memory is to use MemHandleFree, as noted in the documentation.

--
Ben Combee <[EMAIL PROTECTED]>
CodeWarrior for Palm OS technical lead
Palm OS programming help @ www.palmoswerks.com


--
For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/


Reply via email to