Ignore:
Timestamp:
06/13/11 15:15:08 (13 years ago)
Author:
tim
Message:

fixed error condition deadlock in regfi
prevented early garbage collection of hive file handles
fixed module imports under python3

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/python/pyregfi/__init__.py

    r253 r255  
    258258    # Memory management for most regfi structures is taken care of here
    259259    def __del__(self):
    260         regfi.regfi_free_record(self._hive.file, self._base)
     260        if self._base:
     261            regfi.regfi_free_record(self._hive.file, self._base)
    261262
    262263
     
    683684    file = None
    684685    raw_file = None
    685     _root = None
     686    _fh = None
     687    #_root = None
     688
    686689
    687690    ## The root Key of this Hive
     
    723726        # The fileno method may not exist, or it may throw an exception
    724727        # when called if the file isn't backed with a descriptor.
     728        self._fh = fh
    725729        fn = None
    726730        try:
     
    766770   
    767771    def __del__(self):
    768         regfi.regfi_free(self.file)
    769         if self.raw_file != None:
    770             self.raw_file = None
    771 
     772        if self.file:
     773            regfi.regfi_free(self.file)
    772774
    773775    def __iter__(self):
Note: See TracChangeset for help on using the changeset viewer.