Yes, I ended up inserting the destruction into the WM_NCDESTROY handler called by ProcessWindowMessage, which gets called before the focus manager is shut down. -Ben
On Wed, Nov 26, 2008 at 3:31 PM, cpu <[EMAIL PROTECTED]> wrote: > > Ben, look at atlwin.h CWindowImplBaseT< TBase, TWinTraits >>::WindowProc > > I believe that OnFinalMessage(window) is called right there if msg == > WM_NCDESTROY > > right about line 3101 on that file. > > Does that help you sort out this? > > On Nov 23, 3:08 pm, "Ben Goodger (Google)" <[EMAIL PROTECTED]> wrote: >> I was investigating an assert I was seeing in the new InfoBar system, >> and I noticed this interesting condition: >> >> When a window is WM_NCDESTROYed, its focus manager is shut down, >> however the view hierarchy of that window isn't destroyed until the >> WidgetWin is deleted (in OnFinalMessage). >> >> There are cases where the destructors of various views attempt to >> manipulate the focus manager, but in this case the focus manager is >> gone, hence the assert. >> >> Then I noticed code in BrowserView::TabDetachedAt that works around >> this problem for the TabContentsContainerView by forcing the focus >> manager tweaking to be done at a point in time before WM_NCDESTROY >> occurs. So as a quick fix I put logic for the InfoBars in there too. >> >> But this got me to thinking that this is a general weakness of the >> views system and this problem could crop up in other places, where >> they may not be such an easy workaround as my change. So I am >> proposing we delete the RootView in WidgetWin::OnDestroy or when >> handling WM_NCDESTROY but before the focus manager is destroyed, >> rather than wait until the WidgetWin is deleted. >> >> I would tend to prefer OnDestroy, since it feels less ad-hoc, though >> is it possible for a window to receive any messages after WM_DESTROY >> and before WM_NCDESTROY? If so, I'd tend to want to put the >> destruction in the WM_NCDESTROY handler just to be on the safe side. >> >> What do you think? >> >> -Ben > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Chromium-dev" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/chromium-dev?hl=en -~----------~----~----~----~------~----~------~--~---
