提交 0fce4f95 编写于 作者: R Romain Vimont

Properly clean up on exit

The SDL clean up does not crash anymore on exit, probably since the
memory corruption caused by calling SDLNet_TCP_Close() too early has
been resolved.
上级 eb09fefd
......@@ -15,9 +15,7 @@ SDL_bool sdl_init_and_configure(void) {
return SDL_FALSE;
}
// FIXME it may crash in SDL_Quit in i965_dri.so
// As a workaround, do not call SDL_Quit() (we are exiting anyway).
// atexit(SDL_Quit);
atexit(SDL_Quit);
// Bilinear resizing
if (!SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "1")) {
......@@ -187,15 +185,10 @@ void screen_destroy(struct screen *screen) {
SDL_DestroyTexture(screen->texture);
}
if (screen->renderer) {
// FIXME it may crash at exit if we destroy the renderer or the window,
// with the exact same stack trace as <https://bugs.launchpad.net/mir/+bug/1466535>.
// As a workaround, leak the renderer and the window (we are exiting anyway).
//SDL_DestroyRenderer(screen->renderer);
SDL_DestroyRenderer(screen->renderer);
}
if (screen->window) {
//SDL_DestroyWindow(screen->window);
// at least we hide it
SDL_HideWindow(screen->window);
SDL_DestroyWindow(screen->window);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册