Assert screen closed on destroy
The destruction order is important, but tricky, because the screen is open/close by the decoder, but destroyed by scrcpy.c on the main thread. Add assertions to guarantee that the screen is not destroyed before being closed.
This commit is contained in:
@@ -15,6 +15,10 @@
|
||||
struct screen {
|
||||
struct sc_frame_sink frame_sink; // frame sink trait
|
||||
|
||||
#ifndef NDEBUG
|
||||
bool open; // track the open/close state to assert correct behavior
|
||||
#endif
|
||||
|
||||
struct video_buffer vb;
|
||||
struct fps_counter *fps_counter;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user