mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-04 17:10:47 +00:00
Fix an infinite recursion crash when opening the event browser
* If a capture was opened it would recurse between initialising the event browser and the marker breadcrumbs.
This commit is contained in:
@@ -206,8 +206,8 @@ QLayoutItem *BreadcrumbsLayout::takeAt(int index)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
MarkerBreadcrumbs::MarkerBreadcrumbs(ICaptureContext &ctx, QWidget *parent)
|
||||
: QFrame(parent), m_Ctx(ctx)
|
||||
MarkerBreadcrumbs::MarkerBreadcrumbs(ICaptureContext &ctx, IEventBrowser *browser, QWidget *parent)
|
||||
: QFrame(parent), m_Ctx(ctx), m_Browser(browser)
|
||||
{
|
||||
setFont(Formatter::PreferredFont());
|
||||
|
||||
@@ -232,7 +232,7 @@ MarkerBreadcrumbs::~MarkerBreadcrumbs()
|
||||
|
||||
void MarkerBreadcrumbs::OnEventChanged(uint32_t eventId)
|
||||
{
|
||||
const ActionDescription *parent = m_Ctx.GetEventBrowser()->GetActionForEID(m_Ctx.CurEvent());
|
||||
const ActionDescription *parent = m_Browser->GetActionForEID(m_Ctx.CurEvent());
|
||||
|
||||
if(parent != NULL && !(parent->flags & ActionFlags::PushMarker))
|
||||
parent = parent->parent;
|
||||
@@ -276,8 +276,7 @@ void MarkerBreadcrumbs::ConfigurePathMenu(QMenu *menu, const ActionDescription *
|
||||
menu->clear();
|
||||
for(const ActionDescription &child : actions)
|
||||
{
|
||||
if((child.flags & ActionFlags::PushMarker) &&
|
||||
m_Ctx.GetEventBrowser()->IsAPIEventVisible(child.eventId))
|
||||
if((child.flags & ActionFlags::PushMarker) && m_Browser->IsAPIEventVisible(child.eventId))
|
||||
{
|
||||
QAction *menuAction = new QAction(child.customName, menu);
|
||||
|
||||
@@ -331,8 +330,7 @@ void MarkerBreadcrumbs::AddPathButton(const ActionDescription *action)
|
||||
|
||||
for(const ActionDescription &child : action ? action->children : m_Ctx.CurRootActions())
|
||||
{
|
||||
if((child.flags & ActionFlags::PushMarker) &&
|
||||
m_Ctx.GetEventBrowser()->IsAPIEventVisible(child.eventId))
|
||||
if((child.flags & ActionFlags::PushMarker) && m_Browser->IsAPIEventVisible(child.eventId))
|
||||
{
|
||||
hasChildMarkers = true;
|
||||
break;
|
||||
|
||||
@@ -63,7 +63,7 @@ class MarkerBreadcrumbs : public QFrame
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit MarkerBreadcrumbs(ICaptureContext &ctx, QWidget *parent = 0);
|
||||
explicit MarkerBreadcrumbs(ICaptureContext &ctx, IEventBrowser *browser, QWidget *parent = 0);
|
||||
~MarkerBreadcrumbs();
|
||||
|
||||
// when a new event is selected
|
||||
@@ -80,6 +80,7 @@ private:
|
||||
void ConfigurePathMenu(QMenu *, const ActionDescription *);
|
||||
|
||||
ICaptureContext &m_Ctx;
|
||||
IEventBrowser *m_Browser;
|
||||
|
||||
QVector<const ActionDescription *> m_Path;
|
||||
|
||||
|
||||
@@ -3388,7 +3388,7 @@ EventBrowser::EventBrowser(ICaptureContext &ctx, QWidget *parent)
|
||||
box->setContentsMargins(QMargins(0, 0, 0, 0));
|
||||
box->setMargin(0);
|
||||
box->setSpacing(0);
|
||||
m_Breadcrumbs = new MarkerBreadcrumbs(m_Ctx, this);
|
||||
m_Breadcrumbs = new MarkerBreadcrumbs(m_Ctx, this, this);
|
||||
box->addWidget(m_Breadcrumbs);
|
||||
ui->breadcrumbStrip->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Minimum);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user