I tried putting a TQueue of TSubclasses and have an instance of this in my gamestate and at some other places as well. When closing the editor however, visual studio breaks and tells me about an access violation.
Here is my callstack:
UE4Editor-Core.dll!__TBB_machine_cmpswp1() Unknown
UE4Editor-Core.dll!rml::internal::Block::freePublicObject(rml::internal::FreeObject * objectToFree) Line 1149 C++
UE4Editor-Core.dll!scalable_free(void * object) Line 2387 C++
> UE4Editor-Core.dll!FMallocTBB::Free(void * Ptr) Line 115 C++
UE4Editor-AIS-4873-Win64-DebugGame.dll!operator delete(void * Ptr) Line 5 C++
UE4Editor-AIS-4873-Win64-DebugGame.dll!TQueue<TSubclassOf<AAISShipPawnAI>,1>::~TQueue<TSubclassOf<AAISShipPawnAI>,1>() Line 61 C++
[External Code]
UE4Editor-CoreUObject.dll!IncrementalPurgeGarbage(bool bUseTimeLimit, float TimeLimit) Line 983 C++
UE4Editor-CoreUObject.dll!StaticExit() Line 3638 C++
UE4Editor-CoreUObject.dll!TBaseStaticDelegateInstance<void __cdecl(void)>::ExecuteIfSafe() Line 921 C++
UE4Editor.exe!TBaseMulticastDelegate<void>::Broadcast() Line 1030 C++
UE4Editor.exe!FEngineLoop::AppPreExit() Line 2723 C++
UE4Editor.exe!FEngineLoop::Exit() Line 2072 C++
UE4Editor.exe!GuardedMain(const wchar_t * CmdLine, HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, int nCmdShow) Line 153 C++
UE4Editor.exe!WinMain(HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, char * __formal, int nCmdShow) Line 191 C++
[External Code]
This only occurs on shutting the Editor (so far) though. Any ideas what I did wrong?
No ideas on this ? I don’t seem to have enough background knowledge to solve this on my own
I don’t even use new or any other non-engine-defined mallocs, that could mess up the Free calls …
Please note that in terms of Garbage Collection, the only Unreal Engine 4 container that is safe to have UObject or UObject-derived pointers is TArray.
Please also note that for proper functionality in this context every class member should be declared as UPROPERTY().
I would also suggest checking your components in terms of being registered/attached to Root.
If you like to learn more about Garbage Collection in the Engine, please go here: