Bug? (SOLVED) CallSub does not call sub in release (obfuscated)

Daniel Towers

Member
Licensed User
When I call a sub in my library class, I pass it a reference to my activity and the sub that should be called in that Activity once the work in question is completed. Once the library class has completed the work it fires CallSub, passing the Activity and Sub to call back. This works without issue in DEBUG and in RELEASE - but the callBackSub never executes in RELEASE (obfuscated)

LIBRARY CODE:

private callBackActivity as Object
private callBackSub as String

Sub(anActivity as Object, subToCall as String)
callBackActivity = anActivity
callBackSub = subToCall
GoDoSomeWork ' e.g. HTTPJob
End Sub

Sub WorkCompleted
' This line is called in RELEASE (obfuscated) but the sub never fires
CallSub(callBackActivity,callBackSub)
End Sub
 

stevel05

Expert
Licensed User
Longtime User
The sub name will be obfuscated unless you include an underscore in the name (but the contents of the variable callBackSub won't) Try changing the subname to Work_Completed and all should be OK.

If you use a standard of appending a string which includes an underscore, you can forget about this issue
B4X:
private callBackActivity as Object
private callBackSub as String

Setup(Me,"Work")

Sub Setup(anActivity as Object, EventName As String)
callBackActivity = anActivity
callBackSub = EventName & "_Completed"
GoDoSomeWork ' e.g. HTTPJob
End Sub

Sub Work_Completed
' This line is called in RELEASE (obfuscated) but the sub never fires
CallSub(callBackActivity,callBackSub)
End Sub
.
 
Top