GameObject destroy errors reported in editor on the UWP platform
SimonDarksideJ opened this issue · comments
XRTK - Mixed Reality Toolkit Bug Report
Describe the bug
There seems to be an issue with the Spatial Object management where it is cleared prematurely in the editor when the scene is closed.
To Reproduce
- Switch to UWP platform
- Run XRTK in the editor
- Stop the editor
- See error
Expected behavior
No errors
Actual behavior
Your Setup
- Operation system : Windows
- Unity Version : 2019.1.4
- XRTK Version 0.2.0
Could you paste in the error stack trace please?
No stack trace, the only error reported is:
"Can't destroy Transform component of 'Blank Spatial Mesh GameObject'. If you want to destroy the game object, please call 'Destroy' on the game object instead. Destroying the transform component is not allowed."
Interestingly, it doesn't occur when the "Windows Mixed Reality spatial locatability state" is "Inhibited".
Hmm, sounds like a race condition where the object is already cleaned up by the time we iterate over the collection to try and clean up manually. I'll check it out.
When I stared the Holographic emulation everything seemed to work fine for me.
I also didn't have a problem when the WMR Portal was running as well. This seems to only happen when we're not targeting a 3d platform. Maybe we should try to disable the spatial understanding when a compatible device isn't found.
@FejZa could you possibly troubleshoot this with your device connected to the editor?
Will do
One other interesting thing to note, when starting then stopping emulation then trying this again in the editor, I didn't get the errors again until after I restarted the editor.
Here's the list of errors I'm getting atm:
Can't destroy Transform component of 'Main Camera'. If you want to destroy the game object, please call 'Destroy' on the game object instead. Destroying the transform component is not allowed.
0x00007FF78458E2EC (Unity) StackWalker::GetCurrentCallstack
0x00007FF7845917A1 (Unity) StackWalker::ShowCallstack
0x00007FF782CEFA45 (Unity) GetStacktrace
0x00007FF784FB42B0 (Unity) DebugStringToFile
0x00007FF783FFA04F (Unity) CanDestroyObject
0x00007FF783FFD29F (Unity) DestroyObjectHighLevel
0x00007FF784011633 (Unity) DestroyWorldObjects
0x00007FF7827B7254 (Unity) EditorSceneManager::RestoreSceneBackups
0x00007FF782D280CE (Unity) PlayerLoopController::ExitPlayMode
0x00007FF782D37E57 (Unity) PlayerLoopController::SetIsPlaying
0x00007FF782D3AB88 (Unity) Application::TickTimer
0x00007FF782FF8E5B (Unity) MainMessageLoop
0x00007FF783002867 (Unity) WinMain
0x00007FF78594C9CE (Unity) __scrt_common_main_seh
0x00007FF859226FD4 (KERNEL32) BaseThreadInitThunk
0x00007FF859F5CEC1 (ntdll) RtlUserThreadStart
Can't destroy Transform component of 'Blank Spatial Mesh GameObject'. If you want to destroy the game object, please call 'Destroy' on the game object instead. Destroying the transform component is not allowed.
0x00007FF78458E2EC (Unity) StackWalker::GetCurrentCallstack
0x00007FF7845917A1 (Unity) StackWalker::ShowCallstack
0x00007FF782CEFA45 (Unity) GetStacktrace
0x00007FF784FB42B0 (Unity) DebugStringToFile
0x00007FF783FFA04F (Unity) CanDestroyObject
0x00007FF783FFD29F (Unity) DestroyObjectHighLevel
0x00007FF784011633 (Unity) DestroyWorldObjects
0x00007FF7827B7254 (Unity) EditorSceneManager::RestoreSceneBackups
0x00007FF782D280CE (Unity) PlayerLoopController::ExitPlayMode
0x00007FF782D37E57 (Unity) PlayerLoopController::SetIsPlaying
0x00007FF782D3AB88 (Unity) Application::TickTimer
0x00007FF782FF8E5B (Unity) MainMessageLoop
0x00007FF783002867 (Unity) WinMain
0x00007FF78594C9CE (Unity) __scrt_common_main_seh
0x00007FF859226FD4 (KERNEL32) BaseThreadInitThunk
0x00007FF859F5CEC1 (ntdll) RtlUserThreadStart
Can't destroy Transform component of 'UIRaycastCamera'. If you want to destroy the game object, please call 'Destroy' on the game object instead. Destroying the transform component is not allowed.
0x00007FF78458E2EC (Unity) StackWalker::GetCurrentCallstack
0x00007FF7845917A1 (Unity) StackWalker::ShowCallstack
0x00007FF782CEFA45 (Unity) GetStacktrace
0x00007FF784FB42B0 (Unity) DebugStringToFile
0x00007FF783FFA04F (Unity) CanDestroyObject
0x00007FF783FFD29F (Unity) DestroyObjectHighLevel
0x00007FF784011633 (Unity) DestroyWorldObjects
0x00007FF7827B7254 (Unity) EditorSceneManager::RestoreSceneBackups
0x00007FF782D280CE (Unity) PlayerLoopController::ExitPlayMode
0x00007FF782D37E57 (Unity) PlayerLoopController::SetIsPlaying
0x00007FF782D3AB88 (Unity) Application::TickTimer
0x00007FF782FF8E5B (Unity) MainMessageLoop
0x00007FF783002867 (Unity) WinMain
0x00007FF78594C9CE (Unity) __scrt_common_main_seh
0x00007FF859226FD4 (KERNEL32) BaseThreadInitThunk
0x00007FF859F5CEC1 (ntdll) RtlUserThreadStart
Can't destroy Transform component of 'Blank Spatial Mesh GameObject'. If you want to destroy the game object, please call 'Destroy' on the game object instead. Destroying the transform component is not allowed.
0x00007FF78458E2EC (Unity) StackWalker::GetCurrentCallstack
0x00007FF7845917A1 (Unity) StackWalker::ShowCallstack
0x00007FF782CEFA45 (Unity) GetStacktrace
0x00007FF784FB42B0 (Unity) DebugStringToFile
0x00007FF783FFA04F (Unity) CanDestroyObject
0x00007FF783FFD29F (Unity) DestroyObjectHighLevel
0x00007FF784011633 (Unity) DestroyWorldObjects
0x00007FF7827B7254 (Unity) EditorSceneManager::RestoreSceneBackups
0x00007FF782D280CE (Unity) PlayerLoopController::ExitPlayMode
0x00007FF782D37E57 (Unity) PlayerLoopController::SetIsPlaying
0x00007FF782D3AB88 (Unity) Application::TickTimer
0x00007FF782FF8E5B (Unity) MainMessageLoop
0x00007FF783002867 (Unity) WinMain
0x00007FF78594C9CE (Unity) __scrt_common_main_seh
0x00007FF859226FD4 (KERNEL32) BaseThreadInitThunk
0x00007FF859F5CEC1 (ntdll) RtlUserThreadStart
Can't destroy Transform component of 'Blank Spatial Mesh GameObject'. If you want to destroy the game object, please call 'Destroy' on the game object instead. Destroying the transform component is not allowed.
0x00007FF78458E2EC (Unity) StackWalker::GetCurrentCallstack
0x00007FF7845917A1 (Unity) StackWalker::ShowCallstack
0x00007FF782CEFA45 (Unity) GetStacktrace
0x00007FF784FB42B0 (Unity) DebugStringToFile
0x00007FF783FFA04F (Unity) CanDestroyObject
0x00007FF783FFD29F (Unity) DestroyObjectHighLevel
0x00007FF784011633 (Unity) DestroyWorldObjects
0x00007FF7827B7254 (Unity) EditorSceneManager::RestoreSceneBackups
0x00007FF782D280CE (Unity) PlayerLoopController::ExitPlayMode
0x00007FF782D37E57 (Unity) PlayerLoopController::SetIsPlaying
0x00007FF782D3AB88 (Unity) Application::TickTimer
0x00007FF782FF8E5B (Unity) MainMessageLoop
0x00007FF783002867 (Unity) WinMain
0x00007FF78594C9CE (Unity) __scrt_common_main_seh
0x00007FF859226FD4 (KERNEL32) BaseThreadInitThunk
0x00007FF859F5CEC1 (ntdll) RtlUserThreadStart
Can't destroy Transform component of 'Blank Spatial Mesh GameObject'. If you want to destroy the game object, please call 'Destroy' on the game object instead. Destroying the transform component is not allowed.
0x00007FF78458E2EC (Unity) StackWalker::GetCurrentCallstack
0x00007FF7845917A1 (Unity) StackWalker::ShowCallstack
0x00007FF782CEFA45 (Unity) GetStacktrace
0x00007FF784FB42B0 (Unity) DebugStringToFile
0x00007FF783FFA04F (Unity) CanDestroyObject
0x00007FF783FFD29F (Unity) DestroyObjectHighLevel
0x00007FF784011633 (Unity) DestroyWorldObjects
0x00007FF7827B7254 (Unity) EditorSceneManager::RestoreSceneBackups
0x00007FF782D280CE (Unity) PlayerLoopController::ExitPlayMode
0x00007FF782D37E57 (Unity) PlayerLoopController::SetIsPlaying
0x00007FF782D3AB88 (Unity) Application::TickTimer
0x00007FF782FF8E5B (Unity) MainMessageLoop
0x00007FF783002867 (Unity) WinMain
0x00007FF78594C9CE (Unity) __scrt_common_main_seh
0x00007FF859226FD4 (KERNEL32) BaseThreadInitThunk
0x00007FF859F5CEC1 (ntdll) RtlUserThreadStart
Can't destroy Transform component of 'Meshes'. If you want to destroy the game object, please call 'Destroy' on the game object instead. Destroying the transform component is not allowed.
0x00007FF78458E2EC (Unity) StackWalker::GetCurrentCallstack
0x00007FF7845917A1 (Unity) StackWalker::ShowCallstack
0x00007FF782CEFA45 (Unity) GetStacktrace
0x00007FF784FB42B0 (Unity) DebugStringToFile
0x00007FF783FFA04F (Unity) CanDestroyObject
0x00007FF783FFD29F (Unity) DestroyObjectHighLevel
0x00007FF784011633 (Unity) DestroyWorldObjects
0x00007FF7827B7254 (Unity) EditorSceneManager::RestoreSceneBackups
0x00007FF782D280CE (Unity) PlayerLoopController::ExitPlayMode
0x00007FF782D37E57 (Unity) PlayerLoopController::SetIsPlaying
0x00007FF782D3AB88 (Unity) Application::TickTimer
0x00007FF782FF8E5B (Unity) MainMessageLoop
0x00007FF783002867 (Unity) WinMain
0x00007FF78594C9CE (Unity) __scrt_common_main_seh
0x00007FF859226FD4 (KERNEL32) BaseThreadInitThunk
0x00007FF859F5CEC1 (ntdll) RtlUserThreadStart
Can't destroy Transform component of 'Blank Spatial Mesh GameObject'. If you want to destroy the game object, please call 'Destroy' on the game object instead. Destroying the transform component is not allowed.
0x00007FF78458E2EC (Unity) StackWalker::GetCurrentCallstack
0x00007FF7845917A1 (Unity) StackWalker::ShowCallstack
0x00007FF782CEFA45 (Unity) GetStacktrace
0x00007FF784FB42B0 (Unity) DebugStringToFile
0x00007FF783FFA04F (Unity) CanDestroyObject
0x00007FF783FFD29F (Unity) DestroyObjectHighLevel
0x00007FF784011633 (Unity) DestroyWorldObjects
0x00007FF7827B7254 (Unity) EditorSceneManager::RestoreSceneBackups
0x00007FF782D280CE (Unity) PlayerLoopController::ExitPlayMode
0x00007FF782D37E57 (Unity) PlayerLoopController::SetIsPlaying
0x00007FF782D3AB88 (Unity) Application::TickTimer
0x00007FF782FF8E5B (Unity) MainMessageLoop
0x00007FF783002867 (Unity) WinMain
0x00007FF78594C9CE (Unity) __scrt_common_main_seh
0x00007FF859226FD4 (KERNEL32) BaseThreadInitThunk
0x00007FF859F5CEC1 (ntdll) RtlUserThreadStart
Can't destroy Transform component of 'Blank Spatial Mesh GameObject'. If you want to destroy the game object, please call 'Destroy' on the game object instead. Destroying the transform component is not allowed.
0x00007FF78458E2EC (Unity) StackWalker::GetCurrentCallstack
0x00007FF7845917A1 (Unity) StackWalker::ShowCallstack
0x00007FF782CEFA45 (Unity) GetStacktrace
0x00007FF784FB42B0 (Unity) DebugStringToFile
0x00007FF783FFA04F (Unity) CanDestroyObject
0x00007FF783FFD29F (Unity) DestroyObjectHighLevel
0x00007FF784011633 (Unity) DestroyWorldObjects
0x00007FF7827B7254 (Unity) EditorSceneManager::RestoreSceneBackups
0x00007FF782D280CE (Unity) PlayerLoopController::ExitPlayMode
0x00007FF782D37E57 (Unity) PlayerLoopController::SetIsPlaying
0x00007FF782D3AB88 (Unity) Application::TickTimer
0x00007FF782FF8E5B (Unity) MainMessageLoop
0x00007FF783002867 (Unity) WinMain
0x00007FF78594C9CE (Unity) __scrt_common_main_seh
0x00007FF859226FD4 (KERNEL32) BaseThreadInitThunk
0x00007FF859F5CEC1 (ntdll) RtlUserThreadStart
Can't destroy Transform component of 'Blank Spatial Mesh GameObject'. If you want to destroy the game object, please call 'Destroy' on the game object instead. Destroying the transform component is not allowed.
0x00007FF78458E2EC (Unity) StackWalker::GetCurrentCallstack
0x00007FF7845917A1 (Unity) StackWalker::ShowCallstack
0x00007FF782CEFA45 (Unity) GetStacktrace
0x00007FF784FB42B0 (Unity) DebugStringToFile
0x00007FF783FFA04F (Unity) CanDestroyObject
0x00007FF783FFD29F (Unity) DestroyObjectHighLevel
0x00007FF784011633 (Unity) DestroyWorldObjects
0x00007FF7827B7254 (Unity) EditorSceneManager::RestoreSceneBackups
0x00007FF782D280CE (Unity) PlayerLoopController::ExitPlayMode
0x00007FF782D37E57 (Unity) PlayerLoopController::SetIsPlaying
0x00007FF782D3AB88 (Unity) Application::TickTimer
0x00007FF782FF8E5B (Unity) MainMessageLoop
0x00007FF783002867 (Unity) WinMain
0x00007FF78594C9CE (Unity) __scrt_common_main_seh
0x00007FF859226FD4 (KERNEL32) BaseThreadInitThunk
0x00007FF859F5CEC1 (ntdll) RtlUserThreadStart
Can't destroy Transform component of 'Blank Spatial Mesh GameObject'. If you want to destroy the game object, please call 'Destroy' on the game object instead. Destroying the transform component is not allowed.
0x00007FF78458E2EC (Unity) StackWalker::GetCurrentCallstack
0x00007FF7845917A1 (Unity) StackWalker::ShowCallstack
0x00007FF782CEFA45 (Unity) GetStacktrace
0x00007FF784FB42B0 (Unity) DebugStringToFile
0x00007FF783FFA04F (Unity) CanDestroyObject
0x00007FF783FFD29F (Unity) DestroyObjectHighLevel
0x00007FF784011633 (Unity) DestroyWorldObjects
0x00007FF7827B7254 (Unity) EditorSceneManager::RestoreSceneBackups
0x00007FF782D280CE (Unity) PlayerLoopController::ExitPlayMode
0x00007FF782D37E57 (Unity) PlayerLoopController::SetIsPlaying
0x00007FF782D3AB88 (Unity) Application::TickTimer
0x00007FF782FF8E5B (Unity) MainMessageLoop
0x00007FF783002867 (Unity) WinMain
0x00007FF78594C9CE (Unity) __scrt_common_main_seh
0x00007FF859226FD4 (KERNEL32) BaseThreadInitThunk
0x00007FF859F5CEC1 (ntdll) RtlUserThreadStart
Can't destroy Transform component of 'Blank Spatial Mesh GameObject'. If you want to destroy the game object, please call 'Destroy' on the game object instead. Destroying the transform component is not allowed.
0x00007FF78458E2EC (Unity) StackWalker::GetCurrentCallstack
0x00007FF7845917A1 (Unity) StackWalker::ShowCallstack
0x00007FF782CEFA45 (Unity) GetStacktrace
0x00007FF784FB42B0 (Unity) DebugStringToFile
0x00007FF783FFA04F (Unity) CanDestroyObject
0x00007FF783FFD29F (Unity) DestroyObjectHighLevel
0x00007FF784011633 (Unity) DestroyWorldObjects
0x00007FF7827B7254 (Unity) EditorSceneManager::RestoreSceneBackups
0x00007FF782D280CE (Unity) PlayerLoopController::ExitPlayMode
0x00007FF782D37E57 (Unity) PlayerLoopController::SetIsPlaying
0x00007FF782D3AB88 (Unity) Application::TickTimer
0x00007FF782FF8E5B (Unity) MainMessageLoop
0x00007FF783002867 (Unity) WinMain
0x00007FF78594C9CE (Unity) __scrt_common_main_seh
0x00007FF859226FD4 (KERNEL32) BaseThreadInitThunk
0x00007FF859F5CEC1 (ntdll) RtlUserThreadStart
Can't destroy Transform component of 'Blank Spatial Mesh GameObject'. If you want to destroy the game object, please call 'Destroy' on the game object instead. Destroying the transform component is not allowed.
0x00007FF78458E2EC (Unity) StackWalker::GetCurrentCallstack
0x00007FF7845917A1 (Unity) StackWalker::ShowCallstack
0x00007FF782CEFA45 (Unity) GetStacktrace
0x00007FF784FB42B0 (Unity) DebugStringToFile
0x00007FF783FFA04F (Unity) CanDestroyObject
0x00007FF783FFD29F (Unity) DestroyObjectHighLevel
0x00007FF784011633 (Unity) DestroyWorldObjects
0x00007FF7827B7254 (Unity) EditorSceneManager::RestoreSceneBackups
0x00007FF782D280CE (Unity) PlayerLoopController::ExitPlayMode
0x00007FF782D37E57 (Unity) PlayerLoopController::SetIsPlaying
0x00007FF782D3AB88 (Unity) Application::TickTimer
0x00007FF782FF8E5B (Unity) MainMessageLoop
0x00007FF783002867 (Unity) WinMain
0x00007FF78594C9CE (Unity) __scrt_common_main_seh
0x00007FF859226FD4 (KERNEL32) BaseThreadInitThunk
0x00007FF859F5CEC1 (ntdll) RtlUserThreadStart
So the things I don't understand. We're not trying to destroy any transforms in our implementation. We call Destroy on the GameObjects themselves.
I'm wondering if these errors are coming from somewhere in Unity's internal implementation as the scene is cleaned up.
Edited the errors with the internal callstacks