forked from mcneel/rhino-developer-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDispose.rvb
23 lines (21 loc) · 821 Bytes
/
Dispose.rvb
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