Will this cause a memory leak if it's run indefinitely?
@asolace I don't think so, all the variables are initialized inside the tellTime function. So, they should be used only when the program runs after each instance. Once the function ends, the garbage collector should remove them from the heap.
tellTime
stackoverflow.com/questions/140341...
@asolace @alexandrusimandi updated the post ranvir.xyz/blog/running-a-function... with the answer to the memory leak. Hope it helps.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Will this cause a memory leak if it's run indefinitely?
@asolace I don't think so, all the variables are initialized inside the
tellTime
function. So, they should be used only when the program runs after each instance. Once the function ends, the garbage collector should remove them from the heap.stackoverflow.com/questions/140341...
@asolace @alexandrusimandi updated the post ranvir.xyz/blog/running-a-function... with the answer to the memory leak. Hope it helps.