зеркало из https://github.com/mozilla/pjs.git
Bug 596222 - Crash [@ mozilla::widget::WindowHook::Lookup] on shutdown with MaxTo enabled. r=robarnold
This commit is contained in:
Родитель
c22991b938
Коммит
b234bc0b54
|
@ -282,6 +282,17 @@ TaskbarPreview::Disable() {
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
PRBool
|
||||
TaskbarPreview::IsWindowAvailable() const {
|
||||
if (mWnd) {
|
||||
nsWindow* win = nsWindow::GetNSWindowPtr(mWnd);
|
||||
if(win && !win->HasDestroyStarted()) {
|
||||
return PR_TRUE;
|
||||
}
|
||||
}
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
void
|
||||
TaskbarPreview::DetachFromNSWindow() {
|
||||
WindowHook &hook = GetWindowHook();
|
||||
|
|
|
@ -76,6 +76,9 @@ protected:
|
|||
// Detaches this preview from the nsWindow instance it's tied to
|
||||
virtual void DetachFromNSWindow();
|
||||
|
||||
// Determines if the window is available and a destroy has not yet started
|
||||
PRBool IsWindowAvailable() const;
|
||||
|
||||
// Marks this preview as being active
|
||||
virtual nsresult ShowActive(PRBool active) = 0;
|
||||
// Gets a reference to the window used to handle the preview messages
|
||||
|
|
|
@ -76,8 +76,11 @@ TaskbarTabPreview::~TaskbarTabPreview() {
|
|||
|
||||
NS_ASSERTION(!mProxyWindow, "Taskbar proxy window was not destroyed!");
|
||||
|
||||
if (mWnd)
|
||||
if (IsWindowAvailable()) {
|
||||
DetachFromNSWindow();
|
||||
} else {
|
||||
mWnd = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
|
|
@ -101,8 +101,11 @@ TaskbarWindowPreview::TaskbarWindowPreview(ITaskbarList4 *aTaskbar, nsITaskbarPr
|
|||
}
|
||||
|
||||
TaskbarWindowPreview::~TaskbarWindowPreview() {
|
||||
if (mWnd)
|
||||
if (IsWindowAvailable()) {
|
||||
DetachFromNSWindow();
|
||||
} else {
|
||||
mWnd = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
|
|
@ -219,6 +219,11 @@ public:
|
|||
};
|
||||
friend class AutoUseBasicLayerManager;
|
||||
|
||||
PRBool HasDestroyStarted() const
|
||||
{
|
||||
return mOnDestroyCalled;
|
||||
}
|
||||
|
||||
PRBool Destroyed() { return mOnDestroyCalled; }
|
||||
|
||||
protected:
|
||||
|
|
Загрузка…
Ссылка в новой задаче