hecomi / uWindowCapture

This allows you to use Windows Graphics Capture / PrintWindow / BitBlt in Windows to capture multiple windows individually and easily use them as Texture2D in Unity.
https://tips.hecomi.com/entry/2021/04/30/230322
MIT License
505 stars 81 forks source link

Random Crash because of Access Violation (0xc0000005) #25

Closed Kitaps closed 3 years ago

Kitaps commented 3 years ago

First of all, congratulations for your project. It is awesome and works great.

Now to my issue: I have been faced with an error that sometimes when I run my built game it crashes as soon as it starts. This happens rarely and randomly, around 1/10 of the time.

While checking the Unity crash logs I found that:

uWindowCapture.dll caused an Access Violation (0xc0000005)
  in module uWindowCapture.dll at 0033:f76b5372.

and also: Read from location 0000000000000000 caused an access violation.

From the tests I have run, the Crash logs always point to this same issues.

I believe this happens because uWC is trying to access memory in use by another process. But I have not tested that.

I'm currently working with Unity 2019.3.5f1 on a Windows 10 Build 19041

If I missed something please tell me to update my Issue. (Also: uLipSync looks super COOL. I'll check it out as soon as I can)

Kitaps commented 3 years ago

I just noticed that in issue #21 they had the same error log. I'm not currently using the getHight(or Width) but I'll check if it is there somewhere. If not I'll reopen this issue. Thanks :)