# Closing a second window

**URL:** https://discourse.processing.org/t/closing-a-second-window/381
**Category:** Coding Questions
**Created:** [May 25, 2018, 7:55pm UTC](https://discourse.processing.org/t/closing-a-second-window/381 "2018-05-25T19:55:02Z")
**Posts on this page:** 1
**Showing post:** 10

<div class="post-metadata">

### Author: ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)
#### Post date: [May 25, 2018, 10:46pm UTC](https://discourse.processing.org/t/closing-a-second-window/381/10 "2018-05-25T22:46:14Z")

</div>

That PWindow::**exit()** method is never called back.  
Instead, move that **exit()** to the main sketch PApplet in order to avoid that “ThreadDeath”:

```java
@Override void exit() {
  win.dispose();
  super.exit();
}

```

---

_[View the full topic](https://discourse.processing.org/t/closing-a-second-window/381)._
