From ce680ab988559f1d4ae1fd5856cbd57283707f50 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sat, 6 Aug 2011 21:42:30 +0000 Subject: Prevent Widget::hide() from going into an endless loop. --- src/ui/widget.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/ui/widget.cc b/src/ui/widget.cc index 4812b1f..709731e 100644 --- a/src/ui/widget.cc +++ b/src/ui/widget.cc @@ -153,7 +153,7 @@ void Widget::hide() Widget *sibling = next_sibling(); - while (sibling && ((sibling == this) || !sibling->visible())) { + while (sibling && (sibling != this) && !sibling->visible()) { sibling = sibling->next_sibling(); } if (sibling) @@ -289,9 +289,9 @@ Widget *Widget::next_sibling() return 0; } - // find this widget in the parent's children + // find this widget in the parent's children Children::iterator it = parent()->children().begin(); - while (it != parent()->children().end() && (*it) != this) { + while (it != parent()->children().end() && ((*it) != this)) { it++; } -- cgit v1.2.3