(self, c_handle: Optional[MaaImageBufferHandle] = None)
| 256 | _own: bool |
| 257 | |
| 258 | def __init__(self, c_handle: Optional[MaaImageBufferHandle] = None): |
| 259 | self._set_api_properties() |
| 260 | |
| 261 | if c_handle: |
| 262 | self._handle = c_handle |
| 263 | self._own = False |
| 264 | else: |
| 265 | self._handle = Library.framework().MaaImageBufferCreate() |
| 266 | self._own = True |
| 267 | |
| 268 | if not self._handle: |
| 269 | raise RuntimeError("Failed to create string buffer.") |
| 270 | |
| 271 | def __del__(self): |
| 272 | if self._handle and self._own: |
nothing calls this directly
no test coverage detected