Looks like this will throw if close has already been called, is that intentional?