Post

 Resources 

Console

Home | Profile | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 VBGamer
 VBGamer
 Is this a potentional memory leak?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

2dcoder
Knave

83 Posts

Posted - Apr 06 2005 :  3:07:19 PM  Show Profile  Reply with Quote
Example, I have some udt's such as:

public aaa as Type
x as integer
y as single
end type

public bbb()

Then in my main module:

redim bbb(1000) as aaa

When I exit the program do I need to release either the type (aaa) or the array which is (bbb)? And if I do, how do I release them? I tried set as nothing but it didn't work. Thanks for any help.

Edited by - 2dcoder on Apr 06 2005 3:08:49 PM

noi_max
Neophyte

2 Posts

Posted - Apr 06 2005 :  4:55:19 PM  Show Profile  Reply with Quote
I don't think a release is necessary, but if you're concerned about memory you can always erase the array

Erase bbb

Also, how about decalring the datatype up front?

Public bbb() As aaa
ReDim bbb(1000)


Go to Top of Page

2dcoder
Knave

83 Posts

Posted - Apr 07 2005 :  11:38:49 PM  Show Profile  Reply with Quote
Thanks Noi!

I'm declaring in a module, based on a var read from file. Looks like erase is the best option, thanks!
Go to Top of Page

VBBR
Moderator

Brazil
617 Posts

Posted - Apr 08 2005 :  11:05:42 AM  Show Profile  Reply with Quote
"Set xxx = Nothing" only works for classes (objects).

Whatever. Who knows...
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
VBGamer © Go To Top Of Page
This page was generated in 0.08 seconds. Snitz Forums 2000

Copyright © 2002 - 2004 Eric Coleman, Peter Kuchnio , et. al.