Closed claudeha closed 3 years ago
Describe the bug FragM segfaults when navigating the camera when all the text editor tabs have been closed.
To Reproduce Steps to reproduce the behavior:
Expected behavior No crash.
Desktop (please complete the following information):
Additional context This fix prevents the crash (but changing post variables now restart rendering; no big deal...)
diff --git a/Fragmentarium-Source/Fragmentarium/GUI/MainWindow.cpp b/Fragmentarium-Source/Fragmentarium/GUI/MainWindow.cpp index 6232295..eb98252 100644 --- a/Fragmentarium-Source/Fragmentarium/GUI/MainWindow.cpp +++ b/Fragmentarium-Source/Fragmentarium/GUI/MainWindow.cpp @@ -885,6 +885,7 @@ void MainWindow::showWelcomeNote() bool MainWindow::isChangedUniformInBuffershaderOnly() { if(!engine->hasShader() || !engine->hasBufferShader()) return false; + if(!getTextEdit()) return false; QStringList lastSet = getTextEdit()->testParms().split("\n"); bool inBufferShaderOnly = false; if (!lastSet.isEmpty()) {
a better fix would be to shut down all attempted shader program interaction when there are no tabs open.
no tabs means it shouldn't be calling isChangedUniformInBuffershaderOnly()
Describe the bug FragM segfaults when navigating the camera when all the text editor tabs have been closed.
To Reproduce Steps to reproduce the behavior:
Expected behavior No crash.
Desktop (please complete the following information):
Additional context This fix prevents the crash (but changing post variables now restart rendering; no big deal...)