executionContexts returns different object ID in packaged application than in IDE or Standalone (using LC 9.5.1)

7 views
Skip to first unread message

Martin Koob

unread,
Dec 15, 2019, 6:56:49 PM12/15/19
to GLX Application Framework
I am working on building a new standalone using LC 9.5.1.  I create the standalone using the glxApplicationProperties plugin.
Then I package the application with the glxApplicationPackager stack.

I have run up an an issue where the packaged application won't function properly because the executionContexts will return a different value in the packaged application than it does in the IDE or when running from the standalone, which is generated by the glxApplicationProperties plugin, that is saved in the application folder at the same level as the launcher.rev folder .

Stack hierarchy in the application folder is

mainstack.livecode
     - myLibSubstack  
           - myAppSetCredentials
                         - sends callback "myAppSetCredentialsCallback to object getCaller()
           - getCaller()
                          -uses executionContexts to return long id of caller.

private function _getCaller
     get item 1 to -3 of line -3 of the executionContexts
     if there is not an it then
           delete item -1 of it
     end if
     return it
end _getCaller

 
Components
     login.rev
      - card 1
           - setCredentials
                 - calls  myAppSetCredentials
            - myAppSetCredentialsCallback
      - card 2




The problem is that the objectID returned by _getCaller() in the packaged application is that of the stack login.rev and not of card 1 of login.rev  

In the IDE and the standalone the objectID returned by _getCaller() is that of card 1 of login.rev as it should be.

This was not a problem when I was using LC 6.7.3.  

Any suggestions as to why this is happening and how to resolve it?

Thanks.

Martin Koob




Martin Koob

unread,
Dec 15, 2019, 9:01:33 PM12/15/19
to GLX Application Framework
Looking into it further I see that in the packaged application for the password protected stacks the executionContexts only shows the detail to the Stack level.  In the lines of the executionContexts for password protected stacks it will show the stack but not which card > button etc. on the stack is involved in the execution. 

This is a change in LIveCode 9 so I will have to change how I get the IDs of objects calling my handlers for callbacks.

Martin

trevor

unread,
Dec 16, 2019, 8:58:59 AM12/16/19
to GLX Application Framework
On Sunday, December 15, 2019 at 5:56:49 PM UTC-6, Martin Koob wrote:
I am working on building a new standalone using LC 9.5.1.  I create the standalone using the glxApplicationProperties plugin.
Then I package the application with the glxApplicationPackager stack.

...
In the IDE and the standalone the objectID returned by _getCaller() is that of card 1 of login.rev as it should be.

This was not a problem when I was using LC 6.7.3.  

Any suggestions as to why this is happening and how to resolve it?

Hi Martin,

This was a change in LC 8 to fix a security hole that allowed someone to debug password protected stacks. Mark Waddingham and I discuss this and the issue it creates for try/catch and errorDialog as well as solutions for those problems in bug #19113. That was back in 2017 though.


There is also a feature request for a function that would return a reference to the calling script object. It is number #1954. LCB has a `caller` function which returns the calling script object.


-- 
Trevor DeVore
ScreenSteps
Reply all
Reply to author
Forward
0 new messages