# NilObjectException for Thread

**URL:** <https://forum.xojo.com/t/nilobjectexception-for-thread/18366>\
**Category:** General\
**Created:** [August 4, 2014, 4:31pm UTC](https://forum.xojo.com/t/nilobjectexception-for-thread/18366 "2014-08-04T16:31:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ka\_Chan](https://forum.xojo.com/letter_avatar_proxy/v4/letter/k/3bc359/32.png) [@Ka\_Chan](https://forum.xojo.com/u/Ka_Chan)\
**Post date:** [August 4, 2014, 4:31pm UTC](https://forum.xojo.com/t/nilobjectexception-for-thread/18366/1 "2014-08-04T16:31:14Z")

</div>

My application have two window and I have thread1 in one of window. When I call showModule for the window that have thread, thread1.run is working fine. However, If I try to close the application, the NilObjectException occurs for thread1. I think this error is calling destructor for thread1 when the application is closing, but I do not understanding why thread1 is Nil during the application is closing. Can anyone tell me what happen or how this happen to the thread1 when an application is closing?

---

<div class="post-metadata">

**Author:** ![Greg\_O\_Lone](https://forum.xojo.com/user_avatar/forum.xojo.com/greg_o_lone/32/49_2.png) [@Greg\_O\_Lone](https://forum.xojo.com/u/Greg_O_Lone)\
**Post date:** [August 4, 2014, 5:03pm UTC](https://forum.xojo.com/t/nilobjectexception-for-thread/18366/2 "2014-08-04T17:03:16Z")

</div>

If Thread1 is an instance that you dragged onto the window, it ceases to exist when the window is closed.

---

<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:21pm UTC](https://forum.xojo.com/t/nilobjectexception-for-thread/18366/3 "2020-10-29T17:21:38Z")

</div>


