Closed GoogleCodeExporter closed 9 years ago
It seems the deskband implementation of IObjectWithSite::SetSite() doesn't
manage the site reference count properly. It never calls AddRef() when making a
copy of the OLE site and when Release() is called the site is probably freed
too early.
My theory is that that the taskbar try to access the site object internally
after it has been prematurely released. That would explain why the crash
happens in an obscure part of explorer.exe.
From the MSDN documentation for IObjectWithSite::SetSite()
http://msdn.microsoft.com/en-us/library/aa768221%28VS.85%29.aspx
“The object should hold the IUnknown pointer, calling AddRef in doing so. If
the object already has a site, it should first call pUnkSite->AddRef to secure
the new site, call IUnknown::Release on the existing site, and then save
pUnkSite.”
Attaching a patch that implement the behavior described on MSDN.
Another solution would be to manage the site pointer using an ATL smart pointer.
Original comment by alexandre.jasmin
on 7 Jul 2010 at 3:28
Attachments:
Sorry previous patch had incoherent indentation style.
Why is the deskband dll source indented with tabs and the VirtuaWin module
indented with spaces?
Original comment by alexandre.jasmin
on 7 Jul 2010 at 3:38
Attachments:
patch is applied
closing the issue
Original comment by kvasdo...@gmail.com
on 17 Jul 2010 at 2:28
Original issue reported on code.google.com by
alexandre.jasmin
on 6 Jul 2010 at 11:57