mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-26 04:45:03 +08:00
Fix: Keep IScreenShotClass_Cap referenced
This commit is contained in:
@@ -128,12 +128,15 @@ CreateScreenshotInstanceType = ctypes.WINFUNCTYPE(ctypes.c_void_p, ctypes.c_uint
|
|||||||
class IScreenShotClass:
|
class IScreenShotClass:
|
||||||
def __init__(self, ptr):
|
def __init__(self, ptr):
|
||||||
self.ptr = ptr
|
self.ptr = ptr
|
||||||
|
# Keep reference count
|
||||||
|
# so __del__ won't have an empty IScreenShotClass_Cap
|
||||||
|
self.release = IScreenShotClass_Release
|
||||||
|
|
||||||
def cap(self):
|
def cap(self):
|
||||||
return IScreenShotClass_Cap(self.ptr)
|
return IScreenShotClass_Cap(self.ptr)
|
||||||
|
|
||||||
def __del__(self):
|
def __del__(self):
|
||||||
IScreenShotClass_Release(self.ptr)
|
self.release(self.ptr)
|
||||||
|
|
||||||
|
|
||||||
def retry(func):
|
def retry(func):
|
||||||
|
|||||||
Reference in New Issue
Block a user