Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is callPeriodically a concern? #425

Closed
rafaellehmkuhl opened this issue Aug 20, 2021 · 3 comments
Closed

Is callPeriodically a concern? #425

rafaellehmkuhl opened this issue Aug 20, 2021 · 3 comments
Labels
core Issue related to BlueOS-core question Further information is requested

Comments

@rafaellehmkuhl
Copy link
Member

I'm concerned about:

let potato = {
    a: async () => console.log("Potato")
}

callPeriodically(potato.a, 1000)

# somehow potato is dead

What happens if the object that callPeriodically is using dies or the variables used inside potato.a dies ?

Originally posted by @patrickelectric in #412 (comment)

@patrickelectric patrickelectric added core Issue related to BlueOS-core question Further information is requested labels Aug 25, 2021
@patrickelectric
Copy link
Member

callPeriodically should receive a WeakRef and check if it's still available, otherwise it should kill itself.

@Williangalvani
Copy link
Member

I started fixing this at #1316
There are a couple left, but most of them are always consumed by something in the ui

@patrickelectric
Copy link
Member

Fixed by #2430

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Issue related to BlueOS-core question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants