Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Houdini Asset Component being used during C++ destructor causes crash #337

Open
KABoissonneault opened this issue Feb 13, 2025 · 0 comments

Comments

@KABoissonneault
Copy link

When garbage collection runs in Editor config, I often get a crash with the following callstack

>	UnrealEditor-HoudiniEngineRuntime-Win64-Debug.dll!FHoudiniEngineRuntime::UnRegisterHoudiniComponent(UHoudiniAssetComponent * HAC) Line 204	C++
 	UnrealEditor-HoudiniEngineRuntime-Win64-Debug.dll!UHoudiniAssetComponent::~UHoudiniAssetComponent() Line 287	C++
 	[External Code]	
 	UnrealEditor-CoreUObject-Win64-Debug.dll!FObjectPurge::DestroyObjects(bool bUseTimeLimit, double TimeLimit, double StartTime) Line 827	C++
 	UnrealEditor-CoreUObject-Win64-Debug.dll!IncrementalDestroyGarbage(bool bUseTimeLimit, double TimeLimit) Line 4851	C++
 	UnrealEditor-CoreUObject-Win64-Debug.dll!IncrementalPurgeGarbage(bool bUseTimeLimit, double TimeLimit) Line 4525	C++
 	UnrealEditor-CoreUObject-Win64-Debug.dll!PurgeAllUObjectsOnExit() Line 6103	C++
 	UnrealEditor-CoreUObject-Win64-Debug.dll!StaticExit() Line 5496	C++
...

This is caused by the Houdini Asset Component being passed for unregistration while its own destructor is running. An object in the middle of destruction is invalid, and triggers memory sanitizers when running Debug configurations.

The proper way to clean up Unreal code is in the BeginDestroy event on UObject, which UHoudiniAssetComponent already implements to do the same thing. I suggest the destructor simply be removed, Unreal code should not be invoked from C++ destructors, as dependent objects might be cleaned by the garbage collector at that point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant