Blob Blame History Raw
From b6d70c102bafcf3538b4b8e897a67a69847f8072 Mon Sep 17 00:00:00 2001
From: Fabrice Bellet <fabrice@bellet.info>
Date: Sat, 31 Oct 2020 22:24:44 +0100
Subject: [PATCH] fgviewer: disconnect the viewer from the renderer

This prevents a crash on startup when using the --fgviewer
option of the main application.
---
 src/Viewer/fgviewer.cxx | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/Viewer/fgviewer.cxx b/src/Viewer/fgviewer.cxx
index 7fd5a82f5..f83804495 100644
--- a/src/Viewer/fgviewer.cxx
+++ b/src/Viewer/fgviewer.cxx
@@ -263,5 +263,7 @@ fgviewerMain(int argc, char** argv)
     // calls during shutdown will cause crashes.
     osgDB::Registry::instance()->clearObjectCache();
 
+    globals->get_renderer()->setViewer(nullptr);
+
     return result;
 }
-- 
2.26.2