We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 5068

Summary: setFrame on auxiliary thread causes crash
Product: SDL Reporter: Emir Marincic <learath2>
Component: videoAssignee: Ryan C. Gordon <icculus>
Status: ASSIGNED --- QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: HG 2.1   
Hardware: x86_64   
OS: macOS 10.15   
Attachments: setFrame async

Description Emir Marincic 2020-03-30 18:43:51 UTC
Created attachment 4283 [details]
setFrame async

setFrame is only allowed on the main thread, again I'm not sure if you want to support rendering on a thread but this patch fixes the issue. I used GCD to fix it but if you'd rather we use performSelectorOnMainThread again we could use an NSInvocation.
Comment 1 Sam Lantinga 2020-03-30 22:32:22 UTC
I'm not opposed to this specific patch, but SDL window functions are only valid on the main thread, and making some of them work on some platforms on different threads will lead to confusion and broken applications if that behavior is relied upon.

I'm tempted not to include this patch for that reason. Ryan, what are your thoughts?
Comment 2 Emir Marincic 2020-03-31 07:02:00 UTC
FWIW I also thought this was not the greatest idea, the only reason I made a patch is to see how others feel about it, and the fact that neither linux/x11 nor windows imposed the main thread limitation so I wanted to level the behaviour.