예제 #1
0
 def _free_lines(self, ctxt, lines, count):
     try:
         for line in TypePrinter._cached_lines:
             core.BNFreeType(line.type)
             core.BNFreeType(line.rootType)
         TypePrinter._cached_lines = None
         return True
     except:
         log_error(traceback.format_exc())
         return False
예제 #2
0
 def _free_result(self, ctxt, result) -> bool:
     try:
         if TypeParser._cached_result is not None:
             for i in range(TypeParser._cached_result.typeCount):
                 core.BNFreeType(TypeParser._cached_result.types[i].type)
             for i in range(TypeParser._cached_result.variableCount):
                 core.BNFreeType(
                     TypeParser._cached_result.variables[i].type)
             for i in range(TypeParser._cached_result.functionCount):
                 core.BNFreeType(
                     TypeParser._cached_result.functions[i].type)
         TypeParser._cached_result = None
         return True
     except:
         log_error(traceback.format_exc())
         return False
예제 #3
0
 def __del__(self):
     core.BNFreeType(self.handle)
예제 #4
0
	def __del__(self):
		if self._mutable:
			core.BNFreeTypeBuilder(self._handle)
		else:
			core.BNFreeType(self._handle)