smasherprog / screen_capture_lite

cross platform screen/window capturing library
MIT License
619 stars 156 forks source link

Screen capturing stopped after sometime and calling ~ScreenCaptureManager() hangs on Thread_.join(); #44

Closed peererror closed 6 years ago

peererror commented 6 years ago

Hi , I am trying to recode the screen into video file . The library capturescreen like 20 to 50 mins after that it stop calling onNewframe and on this state If I call ~ScreenCaptureManager() it hanged on

else if (Thread_.joinable()) {
                Thread_.join(); //hangs here 
            }
            ScreenCaptureManagerExists = false;
smasherprog commented 6 years ago

Are you using the latest release of this library? 14.0.8

smasherprog commented 6 years ago

It sounds like you might have a dead lock in your code. Try letting the program run without calling your video encode and see if it still hangs. My guess is that the hanging on its destructor is because you have some code that is deadlocked somewhere so the thread cannot join

peererror commented 6 years ago

OK code where this happen is ~ScreenCaptureManager() function of the library . Is deadlock in my code will affect the destructor of the library ? Yes I am using latest 14.0.8

smasherprog commented 6 years ago

I need more information than this. I believe the bug is in your code.

peererror commented 6 years ago

OK let me get back with more info

peererror commented 6 years ago

yes it was problem in my code

smasherprog commented 6 years ago

Glad to hear you figured it out.