Theos PowerBasic Museum 2017

Archive => Discussion - Legacy Software (PBWIN 9.0+/PBCC 5.0+) => Topic started by: Frederick J. Harris on September 24, 2010, 07:42:07 PM

Title: Question About Nothing
Post by: Frederick J. Harris on September 24, 2010, 07:42:07 PM
If one has a reference to a COM object such as pComObj, calling Release() on it will likely decrement its reference count by one ( 1 ).  Asumming the actual reference count on it is 5 and was just decremented to 4 as described above, what then does this do...

Set pComObj=Nothing

Does that then cause the reference count to decrement to zero followed shortly by automatic object unloading?  Or does it just cause a memory leak?
Title: Re: Question About Nothing
Post by: José Roca on September 24, 2010, 08:12:26 PM
It just calls the Release method.
Title: Re: Question About Nothing
Post by: Frederick J. Harris on September 24, 2010, 08:26:49 PM
Ahh!  That's an interesting bit of information.  Thanks!