> If I declare a function (for example), then I dimention and use an
> "OLEObject" variable within that function -- how concerned should I be
about
> cleaning up that variable by setting it to "Nil"? Should I not worry
about
> it because REALbasic's "garbage collection" is so good and/or the variable
> goes out of scope once execution leaves the function and the object is
> cleaned up automatically? Or should I take the VB5/VB6 stance and set
*ALL*
> objects I instantiate equal to "Nil" in order to clean them up and free
> their memory?
Once the variable goes out of scope, it will be automatically destroyed.
Basically, things in RB are reference counted. When the reference count
goes to 0, the object is destroyed. So you don't have to nil things out
explicitly unless you have a circular reference.
So I wouldn't worry about nil'ing your objects. For most cases, it's
unneeded.
HTH!
~Aaron
_______________________________________________
Unsubscribe or switch delivery mode:
<http://support.realsoftware.com/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
|