Strange problem with Beta 2.50 B3

corwin42

Expert
Licensed User
Longtime User
In an app I used Statemanager and HTTPUtils2.

Now I try to replace some static code modules with libraries. I created a library from statemanager and removed it from my app and included the generated library instead. That was the only change I have made to my code. Now I get the following error on compile:


It seems that the compiler thinks that HttpJob is an Activity object now. The error is reported in HttpUtils2Service.SubmitJob

Any ideas? It would be very hard to provide the project.
 

agraham

Expert
Licensed User
Longtime User
I'm not commenting on the problem but on the error message.

Somewhere else a similar error was posted and that error and this error both seem to contain contradictory information. It complains that a Process object is required then suggests declaring it in Sub Globals (where it will be an Activity object) instead of Sub Process_Globals
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Thank you. This bug is fixed for the next update.

About the error message. I agree that it is a bit confusing. However it is correct.

Consider this code:
B4X:
Sub Process_Globals
   Dim m As Map
End Sub

Sub Globals

End Sub

Sub Activity_Create(FirstTime As Boolean)
   Dim b As Button
   m.Put("b", b)
End Sub
The error will show as putting the Button in the process globals Map will create a memory leak. If however you declare the map in Globals instead then it will be fine.
 
Upvote 0

corwin42

Expert
Licensed User
Longtime User
Thank you. This bug is fixed for the next update.

Thanks very much. It was a bit strange because this error occured only after changing a code module into a library. Is there a workaround for this or will you release a new beta today?
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…