Prevent APICache from holding file descriptors open until program exit

Review Request #6899 — Created Feb. 3, 2015 and submitted

brennie
RBTools
master
a272751...
rbtools

Previously the APICache would keep file descriptors open until the
program exited. This was because of a call to atexit.register that
increased the reference count of the APICache. However, we always
write to the database after every database change, so this is
unnecessary. Removing the call to atexit.register allows the open
file descriptors to be closed when an APICache 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 the doit function. After
the change, the list of open file descriptors is always be the
empty list.

  1. Tool: PEP8 Style Checker
    Processed Files:
        rbtools/api/cache.py
    
    
    
    Tool: Pyflakes
    Processed Files:
        rbtools/api/cache.py
    
    
  2. 
      
chipx86
  1. Ship It!
  2. 
      
brennie
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-0.7.x (b61c379)
Loading...