Skip to content

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

Description

@KABoissonneault

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions