cancel
Showing results for 
Search instead for 
Did you mean: 

Is Garbage collection (destroying the objects after usage) automatic in Test Complete?

SOLVED
Highlighted
Occasional Contributor

Is Garbage collection (destroying the objects after usage) automatic in Test Complete?

Dear Experts,

 

Summary: Is garbage collection is automatic in Test Complete scripts?

 

Description:

 

Can any one clarify me that after when we create some objects in Test Complete sripts, do we manually need to destroy/dispose the objects after usage by writing corresponding script lines as shown below, or garbage collection is automatic?

 

ex: Set objHello = CreateObject("WScript.Shell)

----

-----

 

objHello = Nothing ' is this necesary to destroy the object like this?

 

Thanks and Regards,

Jayakoti

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Moderator

Re: Is Garbage collection (destroying the objects after usage) automatic in Test Complete?

TestComplete delegates garbage collection to the language engine, so use whatever practices are used in your language of choice.

 

In VBScript, you do not usually need to set variables to Nothing. The VBScript engine automatically clears variables when they go out of the scope (for example, when a function ends).

 

More info:

If I set a variable using CreateObject(), do I need to clean it up by setting it to Nothing after us...

When Are You Required To Set Objects To Nothing?


Helen Kosova
SmartBear Technical Writer
________________________

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️

View solution in original post

1 REPLY 1
Highlighted
Moderator

Re: Is Garbage collection (destroying the objects after usage) automatic in Test Complete?

TestComplete delegates garbage collection to the language engine, so use whatever practices are used in your language of choice.

 

In VBScript, you do not usually need to set variables to Nothing. The VBScript engine automatically clears variables when they go out of the scope (for example, when a function ends).

 

More info:

If I set a variable using CreateObject(), do I need to clean it up by setting it to Nothing after us...

When Are You Required To Set Objects To Nothing?


Helen Kosova
SmartBear Technical Writer
________________________

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️

View solution in original post

New Here?
Join us and watch the welcome video:
Building with the Collaborator API

Help Documenation
The Collaborator API is a JSON-RPC API that lets you integrate with Collaborator 9.0 and above. For more information about how the API works, check out the API description here:


Sample Plugins
For an example of an add-in that uses the API, take a look at the Microsoft Word Add-in for Collaborator:


We list all the great plugins our network has already built on this page on the SmartBear website.

Labels