Hi John,
The TabContentsViewWin class uses a global TempParent object (content/browser/tab_contents/tab_contents_view_win.cc) as the initial parent for all new TabContents. The TempParent class extends ui::WindowImpl which causes a new class type to be registered by ClassRegistrar in ui/base/win/window_impl.cc. This is problematic because the TempParent object is never destroyed. When the ClassRegistrar is destroyed by AtExitManager the call to UnregisterClass fails with error code 1412 (ERROR_CLASS_HAS_WINDOWS).
According to the MSDN documentation [1] "all window classes that an application registers are unregistered when it terminates." It therefore seems safe to leak the class registration in this case. However, WindowImpl doesn't currently provide a mechanism for leaking class registrations. Should we add this mechanism, or should we create new temporary TempParent object for each TabContents and then destroy it when a different parent is set? What do you think?
Thanks,
Marshall
[1]
http://msdn.microsoft.com/en-us/library/windows/desktop/ms644899%28v=vs.85%29.aspx