Prevent APICache from holding file descriptors open until program exit
Review Request #6899 — Created Feb. 3, 2015 and submitted — Latest diff uploaded
Previously the
APICache
would keep file descriptors open until the
program exited. This was because of a call toatexit.register
that
increased the reference count of theAPICache
. However, we always
write to the database after every database change, so this is
unnecessary. Removing the call toatexit.register
allows the open
file descriptors to be closed when anAPICache
goes out of scope.
Ran unit tests.
I ran the
test.py
file attached in report of issue 3751 before and
after the change. Before the change, the list of open file
descriptors would grow with each call to thedoit
function. After
the change, the list of open file descriptors is always be the
empty list.