In the course of updating my code for the new WaitFor feature (which is fantastic, by the way), I came across some instances where code is processing the HttpJob result and, either, calls another sub (e.g., CallSub(...)) or closes the activity (i.e., Activity.Finish) as a result of the value of returned from the HttpJob. So, I think that the normal implementation with the new WaitFor goes like this:
But, occasionally, I have this/these situation(s):
So, my question is: for this/these latter situation(s), where does the j.Release go? Is j.Release still even necessary?
Is this a possible solution:
Out of curiosity, what happens if j.Release is never called, i.e., just omitted altogether?
B4X:
Wait For (SomeHttpJob) JobDone(j As HttpJob)
If j.Success Then
End If
j.Release
But, occasionally, I have this/these situation(s):
B4X:
Wait For (SomeHttpJob) JobDone(j As HttpJob)
If j.Success Then
CallSub(Main, "SomeSub")
'...or...
Activity.Finish
End If
j.Release 'Is this still needed? Should it go before the CallSub or Activity.Finish?
So, my question is: for this/these latter situation(s), where does the j.Release go? Is j.Release still even necessary?
Is this a possible solution:
B4X:
Wait For (SomeHttpJob) JobDone(j As HttpJob)
If j.Success Then
j.Release
CallSub(Main, "SomeSub")
'...or...
Activity.Finish
End If
Out of curiosity, what happens if j.Release is never called, i.e., just omitted altogether?
Last edited: