One goes out of scope by itself, one doesn't automatically go out of scope...

If it is a modal dialog, the 2nd one works as good as the 1st one but with less codes... You can't say one is better than the other, it depends on situation...