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
+2 -2
View File
@@ -490,8 +490,6 @@ TextureViewer::TextureViewer(ICaptureContext &ctx, QWidget *parent)
ui->sliceFace->setFont(Formatter::PreferredFont());
ui->zoomOption->setFont(Formatter::PreferredFont());
m_Ctx.AddLogViewer(this);
Reset();
on_checkerBack_clicked();
@@ -644,6 +642,8 @@ TextureViewer::TextureViewer(ICaptureContext &ctx, QWidget *parent)
ui->zoomOption->setCurrentText(QString());
ui->fitToWindow->toggle();
m_Ctx.AddLogViewer(this);
SetupTextureTabs();
}