I am seeing errors which I am having trouble tracing in the following code in a Class module. The error log only has 3 lines:
The code extract is
and the code that returns results to the two Wait For lines is:
If I add the following sub:
the problem is pushed down to the second "Wait For" line, and the error log now has these lines:
The (Line: 496) End Sub refers to a sub in a completely separate code module, and I can't see any relevance to the code being executed. If I then add this sub, the problem disappears:
This only happens in Debug mode. In release mode it is fine (even with the #BridgeLogger set).
Is this a bug?
B4X:
Sub Process_AVTAction: MP_Clear_Next Requested
An error occurred:
(Line: 0) End Sub
java.lang.Exception: Sub mp_getupnpcommands_complete signature does not match expected signature.
public static void b4a.themusicmachine.clupnpplayer_subs_0._mp_getupnpcommands_complete(anywheresoftware.b4a.pc.RemoteObject) throws java.lang.Exception
B4X:
MP_GetUPnPCommands
' Wait for it to be done
Wait For MP_GetUPnPCommands_Complete (ContainsStop As Boolean)
If ContainsStop Then
' Now continue with the MP_Stop command
MP_StopAsync
Wait for MP_StopAsync_Complete (MP_Stopped As Boolean)
End If
B4X:
' Responses to UPnPReq other types using parser. Parse the XML string passed in
Sub UPnPReqParser_EndElement(Uri As String, Name As String, Text As StringBuilder)
Dim sNewValue As String = Text.ToString
Try
Select Case Name
(Cases)
....
Case "CurrentTransportState"
(Some Code)
CallSubDelayed2(Me, "MP_StopAsync_Complete", sNewValue = "STOPPED")
Case "Actions"
(Some Code)
CallSubDelayed2(Me, "MP_GetUPnPCommands_Complete", sNewValue.Contains("Stop"))
(More Cases)
End Select
Catch
sErrorMsg = "TBCI App Error: " & CRLF & LastException
TMM.LogError ($"${sCodeName}:${sErrorMsg}"$)
End Try
End Sub
B4X:
Sub MP_GetUPnPCommands_Complete (bResult As Boolean)
End Sub
B4X:
An error occurred:
(Line: 496) End Sub
java.lang.Exception: Sub mp_stopasync_complete signature does not match expected signature.
public static void b4a.themusicmachine.clupnpplayer_subs_1._mp_stopasync_complete(anywheresoftware.b4a.pc.RemoteObject) throws java.lang.Exception
B4X:
Sub MP_StopAsync_Complete (bResult As Boolean)
End Sub
This only happens in Debug mode. In release mode it is fine (even with the #BridgeLogger set).
Is this a bug?