mirror of https://github.com/OpenTTD/OpenTTD
(svn r25550) -Fix [FS#5571]: [Windows] Race condition between two drawing threads could crash OpenTTD
parent
68659495b5
commit
d9065fbfbe
|
@ -176,6 +176,7 @@ static void ClientSizeChanged(int w, int h)
|
||||||
{
|
{
|
||||||
/* allocate new dib section of the new size */
|
/* allocate new dib section of the new size */
|
||||||
if (AllocateDibSection(w, h)) {
|
if (AllocateDibSection(w, h)) {
|
||||||
|
if (_draw_mutex != NULL) _draw_mutex->BeginCritical();
|
||||||
/* mark all palette colours dirty */
|
/* mark all palette colours dirty */
|
||||||
_cur_palette.first_dirty = 0;
|
_cur_palette.first_dirty = 0;
|
||||||
_cur_palette.count_dirty = 256;
|
_cur_palette.count_dirty = 256;
|
||||||
|
@ -190,6 +191,8 @@ static void ClientSizeChanged(int w, int h)
|
||||||
_screen.dst_ptr = _wnd.buffer_bits;
|
_screen.dst_ptr = _wnd.buffer_bits;
|
||||||
UpdateWindows();
|
UpdateWindows();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (_draw_mutex != NULL) _draw_mutex->EndCritical();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue