Android Question [SOLVED] How important is it to release a HttpJob?

Sandman

Expert
Licensed User
Longtime User
Let's say I have a resumable sub that waits for a HttpJob to finish. I dim the HttpJob in the sub.

Do I really need to release the HttpJob? Isn't that done automatically once the sub is finished?
 

DonManfred

Expert
Licensed User
Longtime User
Last edited:
Upvote 0

Sandman

Expert
Licensed User
Longtime User
So, looking at the past, the HttpJob isn't a strictly local variable, as it was fed into the jobdone sub. And just because we now can dim and consume it in the same resumable sub using Wait For doesn't make it a local variable? Because the Wait For construct is just a bit of Erel magic that is still compiled to something like the older jobdone sub? Something like that?
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
HttpJob.Release will not be executed unless you explicitly call it. It doesn't matter how you handle the JobDone event.

The purpose of HttpJob.Release is not to release the reference to the HttpJob object. It deletes the temporary file created while the resource was downloaded.
 
Upvote 0
Top