зеркало из https://github.com/mozilla/pjs.git
Bug 616288 followup, comment fix; a=cleanup-after-myself DONTBUILD
This commit is contained in:
Родитель
755a0dda75
Коммит
87d622673c
|
@ -478,11 +478,9 @@ nsAutoCompleteController::HandleKeyNavigation(PRUint32 aKey, PRBool *_retval)
|
|||
StopSearch();
|
||||
|
||||
if (!mInput) {
|
||||
// Because of the joy of nested event loops (which can easily happen when some
|
||||
// code uses a generator for an asynchronous AutoComplete search),
|
||||
// nsIAutoCompleteSearch::StartSearch might cause us to be detached from our input
|
||||
// field. The next time we iterate, we'd be touching something that we shouldn't
|
||||
// be, and result in a crash.
|
||||
// StopSearch() can call PostSearchCleanup() which might result
|
||||
// in a blur event, which could null out mInput, so we need to check it
|
||||
// again. See bug #395344 for more details
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -1047,9 +1045,11 @@ nsAutoCompleteController::StartSearch()
|
|||
++searchesFailed;
|
||||
--mSearchesOngoing;
|
||||
}
|
||||
// nsIAutoCompleteSearch::StartSearch might cause us to be detached from
|
||||
// our input field, so it's not safe to assume that it's safe to iterate
|
||||
// over the next iteration.
|
||||
// Because of the joy of nested event loops (which can easily happen when some
|
||||
// code uses a generator for an asynchronous AutoComplete search),
|
||||
// nsIAutoCompleteSearch::StartSearch might cause us to be detached from our input
|
||||
// field. The next time we iterate, we'd be touching something that we shouldn't
|
||||
// be, and result in a crash.
|
||||
if (!mInput) {
|
||||
// The search operation has been finished.
|
||||
return NS_OK;
|
||||
|
|
Загрузка…
Ссылка в новой задаче