On 2021-10-07 15:38, Mark Waddingham via use-livecode wrote:
On 2021-10-07 15:26, Pi Digital via use-livecode wrote:
Hi Mark (both :) )

Thanks for your explanation. Very thorough.

What I don’t understand is why the engine needs to delete the old
reference (weak handle) when invoking a ‘save as’. Is it not just a
matter of resaving you a new location and making the pointer to the
storage device for that instance? Why does it need to save it and then
remove from memory at all? Just carry on with what is already in
memory without the need to reload. That’s why we use a ‘save as’
anyway.

This isn't related to 'Save As' - nor is the engine doing anything
here beyond sending a message - which is enforcing the 'only one main
stack with a given (short) name exists in memory at any one time'
invariant.

Sorry Sean this thread had gone on through several things that I missed what you said in your original post...

You explicitly said you were getting that dialog when doing a 'Save As' (presumably from the file menu)... There must be more to it than that though.

The 'Save As' menu item in the IDE uses (with a bit of cruft around it) 'save stack ... as <filename>' - all that does is serialize the stack (as it is in memory) to the new file, and update the filename of the stack in memory.

There should be no reloadStack mechanism (as outlined above) going on *unless* something is causing a message to fire which is trying to load the stack from the previous filename.

Indeed, is this a multi-stack system which you are working on? Is there a way your code (which is being triggered somehow after save) is referencing the stack you just saved as, by its original filename?

Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to