# \[4.7.6\] TQueue Destructor Crash

**URL:** <https://forums.unrealengine.com/t/4-7-6-tqueue-destructor-crash/317199>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [May 2, 2015, 10:49am UTC](https://forums.unrealengine.com/t/4-7-6-tqueue-destructor-crash/317199 "2015-05-02T10:49:17Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_fc4c82b6](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_fc4c82b6](https://forums.unrealengine.com/u/anonymous_user_fc4c82b6)\
**Post date:** [May 2, 2015, 10:49am UTC](https://forums.unrealengine.com/t/4-7-6-tqueue-destructor-crash/317199/1 "2015-05-02T10:49:17Z")

</div>

Hey guys,

I’m experiencing some weird bug here:

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?

Thanks in advance!

PS: I’m working on Windows 8.1 with the binaries

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_fc4c82b6](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_fc4c82b6](https://forums.unrealengine.com/u/anonymous_user_fc4c82b6)\
**Post date:** [May 2, 2015, 3:52pm UTC](https://forums.unrealengine.com/t/4-7-6-tqueue-destructor-crash/317199/2 "2015-05-02T15:52:39Z")

</div>

Maybe the output gives some more information ,not sure:

```
[2015.05.02-13.51.32:172][491]LogExit: Editor shut down
[2015.05.02-13.51.32:173][491]LogExit: Transaction tracking system shut down
[2015.05.02-13.51.32:173][491]LogParticles: Destroying 0 GPU particle simulations for FXSystem 0x000000FD47BCF060
[2015.05.02-13.51.32:174][491]LogParticles: Destroying 0 GPU particle simulations for FXSystem 0x000000FD5521B6A0
[2015.05.02-13.51.32:174][491]LogParticles: Destroying 0 GPU particle simulations for FXSystem 0x000000FD55188720
First-chance exception at 0x00007FF8455B4DB3 (UE4Editor-Core.dll) in UE4Editor.exe: 0xC0000005: Access violation writing location 0x0000000000000010.
Unhandled exception at 0x00007FF8455B4DB3 (UE4Editor-Core.dll) in UE4Editor.exe: 0xC0000005: Access violation writing location 0x0000000000000010.

The program '[7124] UE4Editor.exe' has exited with code 0 (0x0).

```

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_fc4c82b6](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_fc4c82b6](https://forums.unrealengine.com/u/anonymous_user_fc4c82b6)\
**Post date:** [May 10, 2015, 6:23pm UTC](https://forums.unrealengine.com/t/4-7-6-tqueue-destructor-crash/317199/3 "2015-05-10T18:23:50Z")

</div>

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 …

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_8e2766aa](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_8e2766aa](https://forums.unrealengine.com/u/anonymous_user_8e2766aa)\
**Post date:** [May 11, 2015, 7:29am UTC](https://forums.unrealengine.com/t/4-7-6-tqueue-destructor-crash/317199/4 "2015-05-11T07:29:37Z")

</div>

Hello,

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:

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — https://unrealcommunity.wiki/! You will be able to find content from...

Hope this helped!

Good luck!

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_fc4c82b6](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_fc4c82b6](https://forums.unrealengine.com/u/anonymous_user_fc4c82b6)\
**Post date:** [May 11, 2015, 9:14am UTC](https://forums.unrealengine.com/t/4-7-6-tqueue-destructor-crash/317199/5 "2015-05-11T09:14:06Z")

</div>

Okay, I didn’t know about this! I hoped for the TQueue to be compatible as well.

I will take a look into that, thank you a lot!

Have a nice day!

EDIT:(The link you wrote there is just this post?)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_8e2766aa](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_8e2766aa](https://forums.unrealengine.com/u/anonymous_user_8e2766aa)\
**Post date:** [May 11, 2015, 9:17am UTC](https://forums.unrealengine.com/t/4-7-6-tqueue-destructor-crash/317199/6 "2015-05-11T09:17:08Z")

</div>

You are welcome!  
You can read the article here:

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — https://unrealcommunity.wiki/! You will be able to find content from...

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_fc4c82b6](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_fc4c82b6](https://forums.unrealengine.com/u/anonymous_user_fc4c82b6)\
**Post date:** [May 11, 2015, 10:51am UTC](https://forums.unrealengine.com/t/4-7-6-tqueue-destructor-crash/317199/7 "2015-05-11T10:51:45Z")

</div>

I does indeed work when using TArray, I was just too focused on using the “better” design choice (TQueue), but yeah … My bad 😉 Thanks a lot 🙂
