# Demo leaks on exit, I think

**URL:** <https://forum.juce.com/t/demo-leaks-on-exit-i-think/2128>\
**Category:** Audio Plugins\
**Created:** [September 28, 2007, 8:38pm UTC](https://forum.juce.com/t/demo-leaks-on-exit-i-think/2128 "2007-09-28T20:38:48Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rock\_Hardbuns](https://avatars.discourse-cdn.com/v4/letter/r/41988e/32.png) [@Rock\_Hardbuns](https://forum.juce.com/u/Rock_Hardbuns)\
**Post date:** [September 28, 2007, 8:38pm UTC](https://forum.juce.com/t/demo-leaks-on-exit-i-think/2128/1 "2007-09-28T20:38:48Z")

</div>

Happens in toby’s minihost and VST Plugin Analyser. Lots of fluff in the dump, but I figured some context doesn’t hurt.

```auto
..snip..
'VST Plugin Analyser.exe': Loaded 'C:\WINDOWS\system32\msacm32.dll', No symbols loaded.
'VST Plugin Analyser.exe': Loaded 'C:\WINDOWS\system32\uxtheme.dll', No symbols loaded.
'VST Plugin Analyser.exe': Loaded 'C:\VEX\juce\extras\audio plugins\demo\build\VST_Win32\Debug\juce_vst.dll', Symbols loaded.
'VST Plugin Analyser.exe': Loaded 'C:\WINDOWS\system32\msvfw32.dll', No symbols loaded.
JUCE v1.44
'VST Plugin Analyser.exe': Loaded 'C:\WINDOWS\system32\setupapi.dll', No symbols loaded.
'VST Plugin Analyser.exe': Loaded 'C:\WINDOWS\system32\apphelp.dll', No symbols loaded.
'VST Plugin Analyser.exe': Loaded 'C:\WINDOWS\system32\clbcatq.dll', No symbols loaded.
'VST Plugin Analyser.exe': Loaded 'C:\WINDOWS\system32\comres.dll', No symbols loaded.
'VST Plugin Analyser.exe': Loaded 'C:\WINDOWS\system32\cscui.dll', No symbols loaded.
'VST Plugin Analyser.exe': Loaded 'C:\WINDOWS\system32\cscdll.dll', No symbols loaded.
'VST Plugin Analyser.exe': Loaded 'C:\WINDOWS\system32\mscms.dll', No symbols loaded.
'VST Plugin Analyser.exe': Loaded 'C:\WINDOWS\system32\winspool.drv', No symbols loaded.
'VST Plugin Analyser.exe': Loaded 'C:\WINDOWS\system32\icm32.dll', No symbols loaded.
'VST Plugin Analyser.exe': Loaded 'C:\WINDOWS\system32\dciman32.dll', No symbols loaded.
Detected memory leaks!
Dumping objects ->
c:\vex\juce\src\juce_appframework\events\juce_message.h(81) : {1635} normal block at 0x00EBA6F0, 24 bytes long.
 Data: < `, > 88 60 2C 10 CD CD CD CD CD CD CD CD CD CD CD CD 
Object dump complete.
Detected memory leaks!
Dumping objects ->
c:\vex\juce\src\juce_appframework\events\juce_message.h(81) : {1635} normal block at 0x00EBA6F0, 24 bytes long.
 Data: < `, > 88 60 2C 10 CD CD CD CD CD CD CD CD CD CD CD CD 
Object dump complete.
'VST Plugin Analyser.exe': Unloaded 'C:\VEX\juce\extras\audio plugins\demo\build\VST_Win32\Debug\juce_vst.dll'
'VST Plugin Analyser.exe': Unloaded 'C:\WINDOWS\system32\msvfw32.dll'
'VST Plugin Analyser.exe': Unloaded 'C:\WINDOWS\system32\dciman32.dll'
'VST Plugin Analyser.exe': Unloaded 'C:\WINDOWS\system32\cscui.dll'
'VST Plugin Analyser.exe': Unloaded 'C:\WINDOWS\system32\cscdll.dll'
The thread 'Juce Timer' (0x1f8) has exited with code 0 (0x0).
The program '[1756] VST Plugin Analyser.exe: Native' has exited with code 0 (0x0).
```

---

<div class="post-metadata">

**Author:** ![haydxn](https://avatars.discourse-cdn.com/v4/letter/h/5fc32e/32.png) [@haydxn](https://forum.juce.com/u/haydxn)\
**Post date:** [September 29, 2007, 1:17pm UTC](https://forum.juce.com/t/demo-leaks-on-exit-i-think/2128/2 "2007-09-29T13:17:11Z")

</div>

yeah, i noticed that ages ago too - there always seems to be just one message left lying around after it closes. I think I mentioned it to jules, but I can’t remember what he said, or if we know why. But yeah, it’s been like that for a long time.

---

<div class="post-metadata">

**Author:** ![Rock\_Hardbuns](https://avatars.discourse-cdn.com/v4/letter/r/41988e/32.png) [@Rock\_Hardbuns](https://forum.juce.com/u/Rock_Hardbuns)\
**Post date:** [October 1, 2007, 12:59pm UTC](https://forum.juce.com/t/demo-leaks-on-exit-i-think/2128/3 "2007-10-01T12:59:34Z")

</div>

hm, Ok. As long as it is just an object no being deleted, and not an access error or something, there’s no furry hurry.

---

<div class="post-metadata">

**Author:** ![ShareCommunity](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/sharecommunity/32/1748_2.png) [@ShareCommunity](https://forum.juce.com/u/ShareCommunity)\
**Post date:** [October 2, 2007, 9:44am UTC](https://forum.juce.com/t/demo-leaks-on-exit-i-think/2128/4 "2007-10-02T09:44:28Z")

</div>

Heh, looks like you’ve been looking over my shoulder!  
I was just about to say exactly the same thing… :shock:

Curiously, on my XP machine it only does it when using Plogue Bidule as the Vst Host - I haven’t noticed it when running under H. Seib’s VstHost…

`[2476] Detected memory leaks!
[2476] Dumping objects ->
[2476] c:\devel\sandbox\juce\juce\src\juce_appframework\events\juce_message.h(81) : 
[2476] {18761} 
[2476] normal block at 0x0D592D80, 24 bytes long.
[2476] Data: < > 98 18 F2 0C CD CD CD CD CD CD CD CD CD CD CD CD 
[2476] Object dump complete.
[2476] Detected memory leaks!
[2476] Dumping objects ->
[2476] c:\devel\sandbox\juce\juce\src\juce_appframework\events\juce_message.h(81) : 
[2476] {18761} 
[2476] normal block at 0x0D592D80, 24 bytes long.
[2476] Data: < > 98 18 F2 0C CD CD CD CD CD CD CD CD CD CD CD CD 
[2476] Object dump complete.
[2476] WARNING: Visual Leak Detector detected memory leaks!
[2476] ---------- Block 16667 at 0x0D592D80: 24 bytes ----------
[2476] Call Stack:
[2476] c:\devel\sandbox\juce\juce\src\juce_appframework\events\juce_message.h (81): juce::Message::operator new
[2476] c:\devel\sandbox\juce\juce\src\juce_appframework\events\juce_timer.cpp (210): juce::InternalTimerThread::run
[2476] c:\devel\sandbox\juce\juce\src\juce_core\threads\juce_thread.cpp (71): juce::Thread::threadEntryPoint
[2476] c:\devel\sandbox\juce\juce\src\juce_core\threads\juce_thread.cpp (88): juce::juce_threadEntryPoint
[2476] c:\devel\sandbox\juce\juce\build\win32\platform_specific_code\juce_win32_threads.cpp (126): juce::threadEntryProc
[2476] f:\sp\vctools\crt_bld\self_x86\crt\src\threadex.c (348): _callthreadstartex
[2476] f:\sp\vctools\crt_bld\self_x86\crt\src\threadex.c (331): _threadstartex
[2476] 0x7C80B683 (File and line number not available): 
[2476] GetModuleFileNameA
[2476] Data:
[2476] 98 18 F2 0C CD CD CD CD CD CD CD CD CD CD CD CD ........ ........
[2476] CD CD CD CD A4 49 21 0D .....I!. ........
[2476] 
[2476] Visual Leak Detector detected 1 memory leak
[2476] .
[2476] Visual Leak Detector is now exiting.
`

Plogue can be quite touchy about leaky pluggins - but I’ve never noticed it complain when running the Release version or under Plogue Bidue on OSX  
… which makes me think it’s a race or timing issue (Bound to be true, if you study the stack trace :roll: ).

NAP - But interesting

---

<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:** [October 3, 2007, 9:19am UTC](https://forum.juce.com/t/demo-leaks-on-exit-i-think/2128/5 "2007-10-03T09:19:19Z")

</div>

That looks to me like a harmless leak you can get sometimes, where there are still a few messages left on the system message queue when the quit message arrives. Fixing it would be tricky, because you’d need to make the quit message block until all pending messages have been delivered, and that could cause all kinds of mix-ups. If anyone has genuine problems with this, let me know and I’ll see if I can find a good solution.

---

<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:** [May 12, 2017, 10:07am UTC](https://forum.juce.com/t/demo-leaks-on-exit-i-think/2128/6 "2017-05-12T10:07:16Z")

</div>


