On May 1, 2007, at 11:10 PM, Rubber Chicken Software Co. wrote: > Does this create a leak, or is the memory deleted? > > Dim Buff1, Buff2 As MemoryBlock > > Buff1 = NewMemoryBlock(55555) > Buff2 = NewMemoryBlock(99999) > Buff2 = Buff1 > > Does this cause a memory leak of 99999 bytes (approx), or does RB > delete Buff2's pointer as an act of kindness?
When you assign Buff1 to Buff2, the reference count of the object to which Buff2 previously pointed is decremented. Here, that count becomes 0, and so the object is destroyed. You might find <http://www.declaresub.com/article/8/objects-and- object-references> of interest. Charles Yeomans _______________________________________________ Unsubscribe or switch delivery mode: <http://www.realsoftware.com/support/listmanager/> Search the archives: <http://support.realsoftware.com/listarchives/lists.html>
