# TCastleView.Stop called from FINALIZATION section

**URL:** https://forum.castle-engine.io/t/tcastleview-stop-called-from-finalization-section/1526
**Category:** Uncategorized
**Created:** [February 8, 2025, 11:56am UTC](https://forum.castle-engine.io/t/tcastleview-stop-called-from-finalization-section/1526 "2025-02-08T11:56:46Z")
**Posts on this page:** 1
**Showing post:** 5

<div class="post-metadata">

### Author: ![michalis](https://forum.castle-engine.io/user_avatar/forum.castle-engine.io/michalis/32/3_2.png) [@michalis](https://forum.castle-engine.io/u/michalis)
#### Post date: [May 10, 2025, 6:26pm UTC](https://forum.castle-engine.io/t/tcastleview-stop-called-from-finalization-section/1526/5 "2025-05-10T18:26:53Z")

</div>

> [@edj](#):
>
> I found using Application.MainWindow.CloseQuery was a good way to intercept app shutdown before the finalizations.

I will just add that I still don’t recommend `OnCloseQuery` for this purpose, for reasons explained in comment in [Where to intercept closing application? - #3 by michalis](https://forum.castle-engine.io/t/where-to-intercept-closing-application/1897/3) 🙂 I know it works in your project, but in general

- `OnCloseQuery` is a way to “ask for confirmation before closing form (e.g. to save some document)”, not “a place to do cleanup”.

- `Stop` is a place to do cleanup, and if you want `Stop` of your view to happen before some `finalization`, then use `Application.MainWindow.Container.View := nil` , as shown in this thread (point 3 above, which I understand the OP followed) or [Where to intercept closing application? - #3 by michalis](https://forum.castle-engine.io/t/where-to-intercept-closing-application/1897/3) .

---

_[View the full topic](https://forum.castle-engine.io/t/tcastleview-stop-called-from-finalization-section/1526)._
