Skip to content

Commit

Permalink
Fix #108 (#560)
Browse files Browse the repository at this point in the history
^Q^
  • Loading branch information
lanpa authored Feb 26, 2020
1 parent b59430b commit e56a07a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 2 additions & 0 deletions tensorboardX/event_file_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ def close(self):
self._worker.stop()
self._ev_writer.close()
self._event_queue.close()
self._event_queue = None # this is critical
self._worker = None # this is critical too
self._closed = True


Expand Down
7 changes: 1 addition & 6 deletions tests/test_summary_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,9 @@ def test_summary_writer_backcomapt(self):
def test_summary_writer_close(self):
# Opening and closing SummaryWriter a lot should not run into
# OSError: [Errno 24] Too many open files
passed = True
try:
for i in range(1000):
writer = SummaryWriter()
writer.close()
except OSError:
passed = False

assert passed

def test_windowsPath(self):
dummyPath = "C:\\Downloads\\fjoweifj02utj43tj430"
Expand Down

0 comments on commit e56a07a

Please sign in to comment.