#06144: Fixed infinite loop

- fixed infinite loop while building slider list, when more than one
window was created
refs mametesters #06144
This commit is contained in:
ImJezze 2016-03-13 17:18:33 +01:00
parent c2d4e3c018
commit 4de23e7624

View File

@ -281,6 +281,7 @@ void windows_osd_interface::update_slider_list()
{ {
for (win_window_info *window = win_window_list; window != nullptr; window = window->m_next) for (win_window_info *window = win_window_list; window != nullptr; window = window->m_next)
{ {
// check if any window has dirty sliders
if (window->m_renderer && window->m_renderer->sliders_dirty()) if (window->m_renderer && window->m_renderer->sliders_dirty())
{ {
build_slider_list(); build_slider_list();
@ -291,26 +292,13 @@ void windows_osd_interface::update_slider_list()
void windows_osd_interface::build_slider_list() void windows_osd_interface::build_slider_list()
{ {
m_sliders = nullptr; // FIXME: take all sliders from all windows without concatenate them by slider_state->next
slider_state *curr = m_sliders;
for (win_window_info *info = win_window_list; info != nullptr; info = info->m_next) for (win_window_info *window = win_window_list; window != nullptr; window = window->m_next)
{ {
slider_state *window_sliders = info->m_renderer->get_slider_list(); // take the sliders of the first window
if (window_sliders != nullptr) m_sliders = window->m_renderer->get_slider_list();
{ return;
if (m_sliders == nullptr)
{
m_sliders = curr = window_sliders;
}
else
{
while (curr->next != nullptr)
{
curr = curr->next;
}
curr->next = window_sliders;
}
}
} }
} }