Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

libtcod-ruby-test hangs on quit #9

Open
suetanvil opened this issue Jun 8, 2014 · 1 comment
Open

libtcod-ruby-test hangs on quit #9

suetanvil opened this issue Jun 8, 2014 · 1 comment

Comments

@suetanvil
Copy link

The example program libtcod-ruby-test works fine on my system. However, when I exit by pressing ESC, the program closes the main window and hangs. Standard CTRL+C kills the program.

I placed a puts at the end of the program and that executes.

I've tried recompiling libtcod from source against my system's SDL and I still get the same behaviour. Doing a backtrace in gdb shows it's hanging in pthread_join called from SDL_WaitThread() and (via some intermediate functions) SDL_Quit().

I'm running 64-bit Ubuntu 13.10 on an AMD system.

@suetanvil
Copy link
Author

It looks like it's due to the timer subsystem. The thread it's waiting on seems to be launched by that.

As far as I can tell right now, libtcod isn't using the SDL timer but it enables the subsystem. When I disable it:

src/sys_sdl_c.c, line 778:
-       TCOD_IFNOT(SDL_Init(SDL_INIT_TIMER|SDL_INIT_VIDEO) >= 0 ) return;
+/*     TCOD_IFNOT(SDL_Init(SDL_INIT_TIMER|SDL_INIT_VIDEO) >= 0 ) return;*/
+       TCOD_IFNOT(SDL_Init(SDL_INIT_VIDEO) >= 0 ) return;

the problem goes away.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant