This fixes #7604.  It wasn't calling the close routine.