At 02:13 PM 8/12/2005, you wrote:
> Can I free memory using 'delete', if it is set with MemPtrNew() or
MemGluePtrNew?

Not a wise policy. Even if the destructor was empty, you can expect problems
in the future.

I agree. deleting an array that was allocated with MemPtrNew is certainly invalid, and deleting any object that has a constructor could be a problem, especially if there are virtual functions involved. It's best to always pair APIs -- new with delete, MemPtrNew with MemPtrFree.

-- Ben Combee, Senior Software Engineer, palmOne, Inc.
   "Combee on Palm OS" weblog: http://palmos.combee.net/
   Developer Forum Archives:   http://news.palmos.com/read/all_forums/


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

Reply via email to