# Leaked objects in debug mode

**URL:** <https://forum.juce.com/t/leaked-objects-in-debug-mode/15028>\
**Category:** General JUCE discussion\
**Created:** [June 24, 2015, 4:19pm UTC](https://forum.juce.com/t/leaked-objects-in-debug-mode/15028 "2015-06-24T16:19:07Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![xrousaios](https://avatars.discourse-cdn.com/v4/letter/x/e47c2d/32.png) [@xrousaios](https://forum.juce.com/u/xrousaios)\
**Post date:** [June 24, 2015, 4:19pm UTC](https://forum.juce.com/t/leaked-objects-in-debug-mode/15028/1 "2015-06-24T16:19:07Z")

</div>

Hi all,

When I am running&nbsp;my&nbsp;project in debug mode in Visual studio, some&nbsp;leaked&nbsp;objects of class StringArray&nbsp;were left in the memory.  
This is not happend when I am running in release mode either into Visual studio environment, or inside the command prompt window.

Is there any issue about this?&nbsp;

Thanks in advance

George

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [June 24, 2015, 4:23pm UTC](https://forum.juce.com/t/leaked-objects-in-debug-mode/15028/2 "2015-06-24T16:23:04Z")

</div>

Leaks aren't reported in a release build.

If it's only&nbsp;StringArrays&nbsp;then most likely you're doing something silly&nbsp;like using static StringArrays somewhere.

---

<div class="post-metadata">

**Author:** ![xrousaios](https://avatars.discourse-cdn.com/v4/letter/x/e47c2d/32.png) [@xrousaios](https://forum.juce.com/u/xrousaios)\
**Post date:** [June 24, 2015, 5:21pm UTC](https://forum.juce.com/t/leaked-objects-in-debug-mode/15028/3 "2015-06-24T17:21:44Z")

</div>

No, I have no&nbsp;static StringArrays somewhere.

The only I have is, StringArrays inside a structure, which is declared inside a class.

&nbsp;

---

<div class="post-metadata">

**Author:** ![nicolasdanet](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/nicolasdanet/32/56_2.png) [@nicolasdanet](https://forum.juce.com/u/nicolasdanet)\
**Post date:** [June 24, 2015, 5:24pm UTC](https://forum.juce.com/t/leaked-objects-in-debug-mode/15028/4 "2015-06-24T17:24:59Z")

</div>

An old thread that could help ( [http://www.juce.com/forum/topic/leak-detector-and-static-variables](http://www.juce.com/forum/topic/leak-detector-and-static-variables) ).

---

<div class="post-metadata">

**Author:** ![xrousaios](https://avatars.discourse-cdn.com/v4/letter/x/e47c2d/32.png) [@xrousaios](https://forum.juce.com/u/xrousaios)\
**Post date:** [June 26, 2015, 9:00am UTC](https://forum.juce.com/t/leaked-objects-in-debug-mode/15028/5 "2015-06-26T09:00:09Z")

</div>

Ι&nbsp;accidentally did not delete the class.&nbsp;

Now all is going ok.

But, a question is remaining to me, just for the&nbsp;completeness of this issue: &nbsp;Why the leak&nbsp;detector handles the class and its objects (StringArrays) separately?

Thanks for the attention

George

&nbsp;

&nbsp;

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [June 26, 2015, 9:05am UTC](https://forum.juce.com/t/leaked-objects-in-debug-mode/15028/6 "2015-06-26T09:05:03Z")

</div>

The leak detection is a juce feature, not something that the OS or compiler adds - it can only work on classes where you explicitly add the JUCE\_LEAK\_DETECTOR macro.
