Przeglądaj źródła

Fixed the pass system assert when close asv application when running a RPI sample. (#572)

Signed-off-by: Qing Tao <[email protected]>
Qing Tao 2 lat temu
rodzic
commit
f7e6eac49d
1 zmienionych plików z 3 dodań i 2 usunięć
  1. 3 2
      Gem/Code/Source/SampleComponentManager.cpp

+ 3 - 2
Gem/Code/Source/SampleComponentManager.cpp

@@ -1808,8 +1808,10 @@ namespace AtomSampleViewer
     {
         if (m_rpiScene)
         {
-            RPI::RPISystemInterface::Get()->UnregisterScene(m_rpiScene);
+            m_xrPipelines.clear();
+            m_renderPipeline = nullptr;
 
+            RPI::RPISystemInterface::Get()->UnregisterScene(m_rpiScene);
             auto sceneSystem = AzFramework::SceneSystemInterface::Get();
             AZ_Assert(sceneSystem, "Scene system was destroyed before SampleComponentManager was able to unregister the RPI scene.");
             AZStd::shared_ptr<AzFramework::Scene> scene = sceneSystem->GetScene(AzFramework::Scene::MainSceneName);
@@ -1817,7 +1819,6 @@ namespace AtomSampleViewer
             [[maybe_unused]] bool result = scene->UnsetSubsystem(m_rpiScene);
             AZ_Assert(result, "SampleComponentManager failed to unregister its RPI scene from the general scene.");
             
-            m_xrPipelines.clear();
             m_rpiScene = nullptr;
         }
     }