ra1nty / DXcam

A Python high-performance screen capture library for Windows using Desktop Duplication API
MIT License
504 stars 70 forks source link

Access violation after upgrading to python 3.11 #58

Open ninjatall12 opened 1 year ago

ninjatall12 commented 1 year ago

Exception ignored in: <function _compointer_base.del at 0x000001CAA34379C0> Traceback (most recent call last): File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\comtypes__init.py", line 956, in del self.Release() File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\comtypes__init.py", line 1211, in Release return self.com_Release() ^^^^^^^^^^^^^^^^^^^^ OSError: exception: access violation reading 0xFFFFFFFFFFFFFFFF Exception ignored in: <function _compointer_base.del at 0x000001CAA34379C0> Traceback (most recent call last): File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\comtypes\init.py", line 956, in del self.Release() File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\comtypes\init.py", line 1211, in Release return self.com_Release() ^^^^^^^^^^^^^^^^^^^^ OSError: exception: access violation reading 0xFFFFFFFFFFFFFFFF

1756816846 commented 1 year ago

I also encountered this problem

1756816846 commented 1 year ago

windows11

ninjatall12 commented 1 year ago

Same windows 11


From: 1756816846 @.> Sent: Monday, March 20, 2023 11:28:34 AM To: ra1nty/DXcam @.> Cc: ninjatall12 @.>; Author @.> Subject: Re: [ra1nty/DXcam] Access violation after upgrading to python 3.11 (Issue #58)

windows11

— Reply to this email directly, view it on GitHubhttps://github.com/ra1nty/DXcam/issues/58#issuecomment-1476058167, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AOBCN34F3A2CDCGRQUA7VBDW5A5OFANCNFSM6AAAAAAWAKXM7I. You are receiving this because you authored the thread.Message ID: @.***>

1756816846 commented 1 year ago

Same windows 11 ____ From: 1756816846 @.> Sent: Monday, March 20, 2023 11:28:34 AM To: ra1nty/DXcam @.> Cc: ninjatall12 @.>; Author @.> Subject: Re: [ra1nty/DXcam] Access violation after upgrading to python 3.11 (Issue #58) windows11 — Reply to this email directly, view it on GitHub<#58 (comment)>, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AOBCN34F3A2CDCGRQUA7VBDW5A5OFANCNFSM6AAAAAAWAKXM7I. You are receiving this because you authored the thread.Message ID: @.***>

I don't have this problem with Windows 10

ninjatall12 commented 1 year ago

It seems that is problem is caused when switching windows. Desktop Duplication API when alt-tabbing, as it causes the DXGI_ERROR_ACCESS_LOST error. This error usually occurs when the operating system moves the application using the Desktop Duplication API to the background, causing a loss of access to the desktop image.

One way to handle this issue is by properly catching the DXGI_ERROR_ACCESS_LOST error and reinitializing the Duplicator object when this error occurs.

ninjatall12 commented 1 year ago

but its weird why was this only happening in windows 11 and not windows 10 maybe update to the DDA?

AI-M-BOT commented 1 year ago

Since exception can be ignored

    def release(self):
        self.stop()

        try: self._duplicator.release()
        except: pass

        try: self._stagesurf.release()
        except: pass