Only add log viewer at the end of constructors, so the window is ready

* Otherwise if OnLogFileLoaded gets called while adding the log viewer
  the window might be partially constructed and crash.
This commit is contained in:
baldurk
2017-06-09 12:08:39 +01:00
parent 2da46640d0
commit 7fe267d548
4 changed files with 10 additions and 10 deletions
+4 -4
View File
@@ -65,10 +65,6 @@ EventBrowser::EventBrowser(ICaptureContext &ctx, QWidget *parent)
{
ui->setupUi(this);
OnLogfileClosed();
m_Ctx.AddLogViewer(this);
clearBookmarks();
ui->jumpToEID->setFont(Formatter::PreferredFont());
@@ -156,6 +152,10 @@ EventBrowser::EventBrowser(ICaptureContext &ctx, QWidget *parent)
ui->events->header()->setContextMenuPolicy(Qt::CustomContextMenu);
QObject::connect(ui->events->header(), &QHeaderView::customContextMenuRequested, this,
&EventBrowser::events_contextMenu);
OnLogfileClosed();
m_Ctx.AddLogViewer(this);
}
EventBrowser::~EventBrowser()