Removing Object from Service Module

lxracer

Member
Licensed User
Longtime User
Hello, im having problems with removing this object,

Dim aw As ICOSWorldForecast
aw.Initialize("aw")
aw.ApiKey="XXXXXXXXXXXXXXXXXXXXX"
aw.CityName = ctyn
File.WriteString(File.DirInternal,"Weather",StringWithWeatherInfo)
aw = null

i was told i can use " aw = null " to remove from memory
but doesnt seem to work in service module
everything else works except removing it

maybe someone can tell me correct way to remove completly
thanks.:sign0085:
 

lxracer

Member
Licensed User
Longtime User
Alright Thanks, i guess i have to hope the library creator can add a Close Method since
i do not know how to release the internal resources it started, it is a local variable but
i can see it does not close after sub ends, unless you have a suggestion how to close it my self, thanks for your responce
 
Upvote 0

agraham

Expert
Licensed User
Longtime User
If he hasn't provided one its not likely to need a Close method. You are probably worrying unnecessarily. The underlying Java language is a managed language that takes care of memory garbage collection for you. Once the object goes out of scope it is a candidate for garbage collection, but may not actually be released until more memory is needed.
 
Upvote 0

lxracer

Member
Licensed User
Longtime User
Thanks for fast reply, i use this code in a single sub in a service module
which the module stays running in background
the service module only runs the sub getdata once every 1 to 3 hours
sub getdata
i dim it
get and save data to file
end sub
and done with it

after it is dim it creates a RED BORDER around the device screen
and will not remove untill device is restarted
 
Last edited:
Upvote 0
Top