Closed
Bug 671792
Opened 15 years ago
Closed 15 years ago
"ASSERTION: ImmAssociateContextEx failed to restore default IMC"
Categories
(Core :: Widget: Win32, defect)
Tracking
()
RESOLVED
FIXED
mozilla9
People
(Reporter: jruderman, Assigned: bbondy)
References
Details
(Keywords: testcase)
Attachments
(1 file)
|
969 bytes,
patch
|
neil
:
review+
|
Details | Diff | Splinter Review |
1. In the address bar, enter http://www.squarefree.com/bug662261/x.test
2. Right-click Firefox's taskbar icon and select "close all windows"
Result:
###!!! ASSERTION: ImmAssociateContextEx failed to restore default IMC: 'ret || !nsIMM32Handler::IsIMEAvailable()', file widget/src/windows/nsWindow.cpp, line 8038
| Assignee | ||
Comment 1•15 years ago
|
||
I can reproduce this so I'll take it.
| Assignee | ||
Updated•15 years ago
|
Assignee: nobody → netzen
| Assignee | ||
Comment 2•15 years ago
|
||
The assertion was failing because of a GetLastError() of invalid handle on the Win32 API call to "::ImmAssociateContextEx(mWnd, .._)".
The problem was that we were destroying the window twice.
The call "DispatchStandardEvent(NS_DESTROY);" inside "nsWindow::OnDestroy" was sometimes leading to "nsXULWindow::Destroy" which would in turn call "mWindow->Destroy()" a second time. Where the error happened.
We were already checking to make sure we didn't destroy twice with "if (nsnull == mWnd) return NS_OK" in "nsWindow::Destroy()" but this would only check that we finished the WM_DESTROY message, not that we already started the WM_DESTROY message.
Instead we should check that we have started the WM_DESTROY message to ensure the above situation doens't happen. This can be done by changing: "if (nsnull == mWnd) return NS_OK" to " if (mOnDestroyCalled)
return NS_OK;"
Attachment #546938 -
Flags: review?(neil)
| Assignee | ||
Comment 3•15 years ago
|
||
This patch also fixes a different similar error in Bug 622312.
Comment 4•15 years ago
|
||
Aha, so OnDestroy calls DispatchStandardEvent(NS_DESTROY) which normally does nothing, because something else has been destroyed first. But sometimes it hasn't, in which case nsXULWindow tries to destroy the nsWindow again...
| Assignee | ||
Comment 5•15 years ago
|
||
Right, basically from within the destroy it can lead to another destroy. We had a check for double destroy but the way we checked it was if the destroy was done, and not if the destroy had already started.
Updated•15 years ago
|
Attachment #546938 -
Flags: review?(neil) → review+
| Assignee | ||
Updated•15 years ago
|
Attachment #546938 -
Flags: checkin?
| Assignee | ||
Comment 6•15 years ago
|
||
Comment on attachment 546938 [details] [diff] [review]
Patch for ASSERTION: ImmAssociateContextEx failed to restore default IMC
Going to run through try before checkin?
Attachment #546938 -
Flags: checkin?
| Assignee | ||
Comment 7•15 years ago
|
||
pushed to mozilla-inbound.
Comment 8•15 years ago
|
||
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla9
You need to log in
before you can comment on or make changes to this bug.
Description
•