I am refereshing my familiarity with streams by looking at PharoByExample1 which says... "You have to remember that each time you open a stream on a file, you have to close it too."

Does that mean if in Workspace I iteratively develop some code to process a stream, so that I am continually running...
myStream := FileStream readOnlyFileNamed: 'C:\test.txt.
...so that 'myStream' is overwritten each time such that I lose reference to the previous stream, and I am no longer able to send #close to it,
am I creating a memory leak in my image ?

My prior assumption has been that once 'myStream' drops the reference drops to the previous stream, garbage collection would take care of 'everything'.

cheers -ben

Reply via email to