Crash when quitting on macOS when not using OpenGL (original) (raw)
Environment
- OS: macOS
- scrcpy version: dev
- installation method: manual build
Bug
When running scrcpy on macOS, and not using the OpenGL renderer,display->gl_context
is not initialised, which leads to a crash when quitting.
PR coming.
DEBUG: User requested to quit
DEBUG: quit...
DEBUG: Demuxer 'video': end of frames
DEBUG: Receiver stopped
[server] DEBUG: Controller stopped
[server] DEBUG: Device message sender stopped
Process 15529 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=EXC_I386_GPFLT)
frame #0: 0x00007fff729726e5 libobjc.A.dylib`objc_retain + 21
libobjc.A.dylib`objc_retain:
-> 0x7fff729726e5 <+21>: andq (%rdi), %rax
0x7fff729726e8 <+24>: testb $0x4, 0x20(%rax)
0x7fff729726ec <+28>: je 0x7fff72972716 ; <+70>
0x7fff729726ee <+30>: movabsq $0x100000000000000, %rcx ; imm = 0x100000000000000
[server] DEBUG: Screen streaming stopped
(lldb) thread backtrace 1
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=EXC_I386_GPFLT)
* frame #0: 0x00007fff729726e5 libobjc.A.dylib`objc_retain + 21
frame #1: 0x00000001008d4da5 libSDL2-2.0.0.dylib`Cocoa_GL_DeleteContext + 37
frame #2: 0x00000001000132a9 scrcpy`sc_display_destroy(display=0x00000001000c08c8) at display.c:117:5
frame #3: 0x000000010001fbd9 scrcpy`sc_screen_destroy(screen=0x00000001000c08b8) at screen.c:575:5
frame #4: 0x000000010001e789 scrcpy`scrcpy(options=0x00007ffeefbff1d0) at scrcpy.c:915:9
frame #5: 0x00000001000058c7 scrcpy`main_scrcpy(argc=3, argv=0x00007ffeefbff350) at main.c:88:52
frame #6: 0x00000001000057a2 scrcpy`main(argc=3, argv=0x00007ffeefbff350) at main.c:107:12
frame #7: 0x00007fff73b27cc9 libdyld.dylib`start + 1