提交 49d1ec86 编写于 作者: W wang rong

SDL: fix a crash issue caused by sdl clipboard

We should not call SDL_PumpEvents in this clipboard related interface.
SDL_PumpEvents should only be called in mainloop.
Please refer the remarks about SDL_PumpEvents here:
wiki.libsdl.org/CategoryAPI
Delete SDL_PumpEvents here will not impact the functionality of
SDL_GetClipboardText theoretically. Because, the mainloop will
call SDL_PumpEvents frequentlyl to update the events in time.
Will not so timely as call it here, but can avoid aynchronous
issue, which worth the cost.
上级 83b161d5
diff --git a/src/video/x11/SDL_x11clipboard.c b/src/video/x11/SDL_x11clipboard.c
index fad8c9c..01da9be 100644
--- a/src/video/x11/SDL_x11clipboard.c
+++ b/src/video/x11/SDL_x11clipboard.c
@@ -148,7 +148,6 @@ X11_GetClipboardText(_THIS)
waitStart = SDL_GetTicks();
videodata->selection_waiting = SDL_TRUE;
while (videodata->selection_waiting) {
- SDL_PumpEvents();
waitElapsed = SDL_GetTicks() - waitStart;
/* Wait one second for a clipboard response. */
if (waitElapsed > 1000) {
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册