# How to kill a dynamic container reference?

**URL:** <https://forum.xojo.com/t/how-to-kill-a-dynamic-container-reference/20429>\
**Category:** General\
**Created:** [November 19, 2014, 8:04pm UTC](https://forum.xojo.com/t/how-to-kill-a-dynamic-container-reference/20429 "2014-11-19T20:04:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mike\_Cotrone](https://forum.xojo.com/user_avatar/forum.xojo.com/mike_cotrone/32/19940_2.png) [@Mike\_Cotrone](https://forum.xojo.com/u/Mike_Cotrone)\
**Post date:** [November 19, 2014, 8:04pm UTC](https://forum.xojo.com/t/how-to-kill-a-dynamic-container-reference/20429/1 "2014-11-19T20:04:32Z")

</div>

I have a container I dynamically embedwithin a window. I add this into an array and manage the app. I then close that container in the array, set it to Nil, and then remove it from the array. The window still holds a reference to it and I am trying to figure out what I am missing in order to delete the window’s reference to this container.

```auto
      // CREATE THE DevProfileContainer
      DynDevProfileClass.DynDevProfileContainer = New DevProfileContainer
      DynDevProfileClass.DynDevProfileContainer.Left = 230
      DynDevProfileClass.DynDevProfileContainer.Top = 104
      DynDevProfileClass.DynDevProfileContainer.EmbedWithin(AristaEAPI_Window)
      // APPEND TO DynDevProfileClassArray
      Common_Module.DynDevProfileClassArray.Append DynDevProfileClass
```

```auto
  // REMOVE ALL ASSOCIATED CONTAINERS/SOCKETS/ETC.
  AristaEAPI_Window.DynResultsContainerArray(AristaEAPI_Window.SelectedIndexID).Visible = False
  AristaEAPI_Window.DynResultsContainerArray(AristaEAPI_Window.SelectedIndexID).Close
  AristaEAPI_Window.DynResultsContainerArray(AristaEAPI_Window.SelectedIndexID) = Nil
 Common_Module.DynDevProfileClassArray.Remove AristaEAPI_Window.SelectedIndexID
```

this is after the above snippet runs.

![](http://i60.tinypic.com/anolqh.png)

I know I must be missing something?

Thank you much in advance!

---

<div class="post-metadata">

**Author:** ![Mike\_Cotrone](https://forum.xojo.com/user_avatar/forum.xojo.com/mike_cotrone/32/19940_2.png) [@Mike\_Cotrone](https://forum.xojo.com/u/Mike_Cotrone)\
**Post date:** [November 19, 2014, 8:30pm UTC](https://forum.xojo.com/t/how-to-kill-a-dynamic-container-reference/20429/2 "2014-11-19T20:30:43Z")

</div>

I found this:

[http://forums.realsoftware.com/viewtopic.php?f=1&t=47030&p=263213](http://forums.realsoftware.com/viewtopic.php?f=1&t=47030&p=263213)

Which looks like what I need to track my Window References so I can kill them 🙂

---

<div class="post-metadata">

**Author:** ![Mike\_Cotrone](https://forum.xojo.com/user_avatar/forum.xojo.com/mike_cotrone/32/19940_2.png) [@Mike\_Cotrone](https://forum.xojo.com/u/Mike_Cotrone)\
**Post date:** [November 19, 2014, 9:07pm UTC](https://forum.xojo.com/t/how-to-kill-a-dynamic-container-reference/20429/3 "2014-11-19T21:07:41Z")

</div>

I am still struggling on how to delete this reference… Any advice would be appreciated 🙂

I just need to kill the reference of the dynamic container on the window without closing that window.

---

<div class="post-metadata">

**Author:** ![Mike\_Cotrone](https://forum.xojo.com/user_avatar/forum.xojo.com/mike_cotrone/32/19940_2.png) [@Mike\_Cotrone](https://forum.xojo.com/u/Mike_Cotrone)\
**Post date:** [November 19, 2014, 9:25pm UTC](https://forum.xojo.com/t/how-to-kill-a-dynamic-container-reference/20429/4 "2014-11-19T21:25:16Z")

</div>

The moral to my story above is to .CLOSE all of your dynamic containers — not _some_ of them 🙂 I had an ID10T error 🙂

---

<div class="post-metadata">

**Author:** ![system](https://forum.xojo.com/uploads/default/original/1X/455b4dcc0e61630e9f81940004ddffa49c432a46.png) [@system](https://forum.xojo.com/u/system)\
**Post date:** [October 29, 2020, 5:29pm UTC](https://forum.xojo.com/t/how-to-kill-a-dynamic-container-reference/20429/5 "2020-10-29T17:29:47Z")

</div>


