From cd47dfa229e168b5c2d414295714aab1790fb992 Mon Sep 17 00:00:00 2001 From: Florian Bach Date: Thu, 9 Dec 2021 16:53:13 +0100 Subject: [PATCH] Ignore exception on free in cpuid.py --- calibre-plugin/cpuid.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/calibre-plugin/cpuid.py b/calibre-plugin/cpuid.py index b0d51a4..226579c 100644 --- a/calibre-plugin/cpuid.py +++ b/calibre-plugin/cpuid.py @@ -137,9 +137,12 @@ class CPUID(object): elif self.libc: # Seems to throw exception when the program ends and # libc is cleaned up before the object? - self.libc.free.restype = None - self.libc.free.argtypes = [c_void_p] - self.libc.free(self.addr) + try: + self.libc.free.restype = None + self.libc.free.argtypes = [c_void_p] + self.libc.free(self.addr) + except: + pass if __name__ == "__main__": def valid_inputs():