Skip to content
Browse files

MythUIButtonTree: Fix an abort when scrolling.

The sanity checks in SetTreeState() were wrong causing an occasional abort when
scrolling around. This actually fixes the crash in ticket #9620 but the root
cause still remains which is the wrong node somehow gets the focus after
the tree is assigned if the top level node has two or more nodes. Refs #9620.
  • Loading branch information
Paul Harrison
Paul Harrison committed Jun 22, 2011
1 parent 0b68b56 commit 5ff3b8bbea2c61b2e87a0e6c55cd12ebf8d885d3
Showing with 2 additions and 2 deletions.
  1. +2 −2 mythtv/libs/libmythui/mythuibuttontree.cpp
@@ -96,10 +96,10 @@ void MythUIButtonTree::SetTreeState(bool refreshAll)
QList<MythGenericTree*> route = m_currentNode->getRoute();

// Sanity Checks
if (m_depthOffset > route.size())
if (m_depthOffset >= route.size())
m_depthOffset = 0;

if (((int)m_currentDepth + m_depthOffset) > route.size())
if (((int)m_currentDepth + m_depthOffset) >= route.size())
m_currentDepth = 0;

MythGenericTree *node = + m_depthOffset);

0 comments on commit 5ff3b8b

Please sign in to comment.
You can’t perform that action at this time.