On 11/2/2025 9:26 AM, Vadim Zeitlin wrote:
> On Wed, 29 Oct 2025 11:15:10 -0700 David Connet wrote:
>
> DC> I just noticed that closing a wxDocument is working differently since
> DC> 3.1.6 (I only tested this in 3.1.6, 3.3.1, trunk - so I'm not sure when
> DC> it changed)
> DC>
> DC> In the past wxDocument::OnCloseDocument was called when I closed my
> DC> program. Now it isn't. I do have an odd setup - it's a single doc /
> DC> multi view setup.
>
> There is nothing particularly odd about this, but I don't have a simple
> way to test it and so would appreciate, as usual, if you could please
> provide a minimal patch to the docview sample demonstrating the problem.
I'll try to get to the root of this... I suspect it's something to do
with my multiview/single-doc setup. (First thing to so is run the sample
in the debugger to see the path of how it closes. And then backtrack
mine to see where that deviates... But in the meantime, (sigh) the job
calls...)
In the meantime, I did find a workaround by
```
void CAgilityBookDoc::OnChangedViewList()
{
// Same as base class, but added OnCloseDocument because it's not
happening.
if (m_documentViews.empty() && OnSaveModified())
{
#if wxCHECK_VERSION(3, 3, 0)
OnCloseDocument();
#endif
delete this;
}
}
```
Dave