# Thread::~Thread assert

**URL:** <https://forum.juce.com/t/thread-thread-assert/5826>\
**Category:** General JUCE discussion\
**Created:** [October 29, 2010, 5:25pm UTC](https://forum.juce.com/t/thread-thread-assert/5826 "2010-10-29T17:25:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![X-Ryl669](https://avatars.discourse-cdn.com/v4/letter/x/a5b964/32.png) [@X-Ryl669](https://forum.juce.com/u/X-Ryl669)\
**Post date:** [October 29, 2010, 5:25pm UTC](https://forum.juce.com/t/thread-thread-assert/5826/1 "2010-10-29T17:25:18Z")

</div>

I think you should add such an assert in the Thread’s destructor:

```auto
// If the thread is still running while the base class destructor is called, this probably mean that the run method is still using members of the deleted child class.
// So don't do that, call stopThread in your own destructor.
jassert(!isThreadRunning());
```

---

<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 29, 2010, 6:06pm UTC](https://forum.juce.com/t/thread-thread-assert/5826/2 "2010-10-29T18:06:30Z")

</div>

Yes, good idea! Thanks!
