|
|
|
|
|
by tantalor
1094 days ago
|
|
Thanks, that's exactly what I was wondering. What happens if you save a reference to (or return, etc.) the variable you declared with "using"? Then it will end up automatically disposed, but from the programmers point of view it should still be usable (not disposed). |
|
Then that programmer had their hopes too high. The basic "using" keyword is not for variables you want to move between scopes. Javascript doesn't do reference counting.
For saving/returning, you need to use explicit instances of DisposableStack and .move()