Skip to content

Commit

Permalink
Fix crash on exit
Browse files Browse the repository at this point in the history
  • Loading branch information
iBicha committed Sep 8, 2023
1 parent 703fea1 commit 9dab7d9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
6 changes: 5 additions & 1 deletion playlet-lib/src/source/asyncTask/asyncTask.bs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ function GetComponentName(taskFunc as object) as string
if IsString(taskFunc)
return `${taskFunc}_asynctask`
end if
return `${FuncName(taskFunc)}_asynctask`
' NOTE: do NOT use FuncName in here.
' we use:
' return `${FuncName(taskFunc)}_asynctask`
' The app hangs on exit, and the TV crashes and restarts. I'm not kidding.
return (LCase(`${taskFunc}_asynctask`)).replace("function:", "").trim()
end function

function OnTaskState(e as object) as void
Expand Down
6 changes: 1 addition & 5 deletions playlet-lib/src/source/utils/Types.bs
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,5 @@ function ValidInt(obj as dynamic) as integer
end function

function FuncName(func as function) as string
if func <> invalid and GetInterface(func, "ifToStr") <> invalid
return func.toStr().replace("Function: ", "")
end if

return ""
return (LCase(`${func}`)).replace("function:", "").trim()
end function
5 changes: 0 additions & 5 deletions tools/bs-plugins/manifest-edit-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,6 @@ export class ManifestEditPlugin implements CompilerPlugin {
if (debug) {
// Host IP address
manifestContent = manifestContent.replace(/DEBUG_HOST_IP_ADDRESS/i, `${ip.address()}`)

// Run as process to use the Roku Resource Monitor
if (manifestContent.indexOf('run_as_process=1') < 0) {
manifestContent += '\nrun_as_process=1';
}
}

// Test flag
Expand Down

0 comments on commit 9dab7d9

Please sign in to comment.