Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

file 23 lines (21 sloc) 0.821 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Dispose.rvb -- April 2010
' If this code works, it was written by Dale Fugier.
' If not, I don't know who wrote it.
' Works with Rhino 4.0.
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

Option Explicit

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Disposes of dictionaries, arrays, and variables
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Sub Dispose(ByRef obj)
  If IsObject(obj) Then
    If LCase(TypeName(obj)) = "dictionary" Then
     obj.RemoveAll ' Remove all key, item pairs
    End If
    Set Obj = Nothing ' Disassociate
  ElseIf IsArray(obj) Then
    Erase obj ' Clear the array
  End If
  obj = Empty ' Uninitialize
End Sub
Something went wrong with that request. Please try again.