Skip to content

Commit e5baf34

Browse files
committed
[Bug 16886][emscripten] Don't close stack while saving standalone
Use the `revert` command to restore the stack to it's pre-cleaning state.
1 parent 69a2fb3 commit e5baf34

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

docs/notes/bugfix-16886.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Don't close stack while saving as HTML5 standalone

ide-support/revsaveasemscriptenstandalone.livecodescript

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ end getAssetFilesFromPath
472472
-- and then returns the modified stack file's contents as data.
473473
-- <pStackFile> is not modified.
474474
private function getPreparedStackAsData pStackFile, pBuildFolder
475-
local tStack, tError, tResult
475+
local tStack, tDefaultStack, tError, tResult
476476
local tTempFile, tCleanTempFile
477477
local tStandaloneSettings
478478
local tStackData
@@ -505,8 +505,7 @@ private function getPreparedStackAsData pStackFile, pBuildFolder
505505
set the customProperties["cRevStandaloneSettings"] of tStack to tStandaloneSettings
506506
end if
507507

508-
-- Save the modified stack to the temporary file, and
509-
-- destroy it
508+
-- Save the modified stack to the temporary file
510509
lock messages
511510
lock screen
512511

@@ -515,10 +514,13 @@ private function getPreparedStackAsData pStackFile, pBuildFolder
515514
if tResult is not empty then
516515
throw tTempFile & ":" && tResult
517516
end if
518-
519517
set the filename of tStack to pStackFile
520-
set the cantDelete of tStack to false
521-
delete tStack
518+
519+
-- Revert to unmodified state
520+
put the defaultStack into tDefaultStack
521+
set the defaultStack to tStack
522+
revert
523+
set the defaultStack to tDefaultStack
522524

523525
unlock screen
524526
unlock messages

0 commit comments

Comments
 (0)