Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

OSX fix joining main thread with calling thread when exiting #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

brainstormi
Copy link

Current commit fixes a segfault when terminating the app in OSX.
Continue to be issues with dtor_Texture that generates a different segfault in current demos, so to be able to replicate the segfault fixed by this commit, limit the code to create a window and exit.
On OSX we have to use erl_drv_steal_main_thread, a not documented function to run SDL2 in main thread. In the same way, to join it again with the calling thread when exiting, we have to invoke erl_drv_stolen_main_thread_join instead of enif_thread_join like in Windows/Linux.

@essen
Copy link
Member

essen commented Dec 21, 2015

I totally missed that. Nice find. Will see if I can try it tomorrow.

@brainstormi brainstormi changed the title OSX fix joining main tread with calling thread when exiting OSX fix joining main thread with calling thread when exiting Dec 21, 2015
@essen
Copy link
Member

essen commented Dec 22, 2015

I don't think I will have time today. I will get back to you. Thanks!

@brainstormi
Copy link
Author

Added a new PR #12 that should fix all the remaing seg faults in OSX/Windows environments, discussed in issue #2

Serneum pushed a commit to Serneum/esdl2 that referenced this pull request Aug 30, 2016
Serneum pushed a commit to Serneum/esdl2 that referenced this pull request Aug 30, 2016
Serneum pushed a commit to Serneum/esdl2 that referenced this pull request Sep 13, 2016
@essen essen added the Bug label Nov 1, 2016
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants