Bug 562253 - Ensure the proxy window is destroyed before tearing down the taskbar preview r=jimm

This commit is contained in:
Rob Arnold 2010-05-12 14:31:24 -04:00
Родитель 13ef0df01c
Коммит 97fa759278
1 изменённых файлов: 12 добавлений и 1 удалений

Просмотреть файл

@ -69,6 +69,13 @@ TaskbarTabPreview::~TaskbarTabPreview() {
::DestroyIcon(mIcon);
mIcon = NULL;
}
// We need to ensure that proxy window disappears or else Bad Things happen.
if (mProxyWindow)
Disable();
NS_ASSERTION(!mProxyWindow, "Taskbar proxy window was not destroyed!");
if (mWnd)
DetachFromNSWindow();
}
@ -271,7 +278,11 @@ TaskbarTabPreview::Enable() {
nsresult
TaskbarTabPreview::Disable() {
TaskbarPreview::Disable();
// TaskbarPreview::Disable assumes that mWnd is valid but this method can be
// called when it is null iff the nsWindow has already been destroyed and we
// are still visible for some reason during object destruction.
if (mWnd)
TaskbarPreview::Disable();
if (FAILED(mTaskbar->UnregisterTab(mProxyWindow)))
return NS_ERROR_FAILURE;