GUAC-1028: Fix race condition on terminal resize.

This commit is contained in:
Michael Jumper 2015-02-05 17:21:33 -08:00
parent 348dc9a1ba
commit da367b373f

View File

@ -1220,6 +1220,9 @@ int guac_terminal_resize(guac_terminal* terminal, int width, int height) {
guac_client* client = display->client;
guac_socket* socket = client->socket;
/* Acquire exclusive access to terminal */
guac_terminal_lock(terminal);
/* Calculate available display area */
int available_width = width - GUAC_TERMINAL_SCROLLBAR_WIDTH;
if (available_width < 0)
@ -1250,6 +1253,9 @@ int guac_terminal_resize(guac_terminal* terminal, int width, int height) {
}
/* Release terminal */
guac_terminal_unlock(terminal);
guac_terminal_notify(terminal);
return 0;