зеркало из https://github.com/mozilla/gecko-dev.git
don't crash in autocomplete code when a search is requested without a valid session. b=288124 r=smfr
This commit is contained in:
Родитель
72c1853760
Коммит
7eada907b5
|
@ -323,10 +323,18 @@ NS_IMPL_ISUPPORTS1(AutoCompleteListener, nsIAutoCompleteListener)
|
|||
|
||||
- (void)cleanup
|
||||
{
|
||||
[mSearchString release]; mSearchString = nil;
|
||||
[mPopupWin release]; mPopupWin = nil;
|
||||
[mDataSource release]; mDataSource = nil;
|
||||
[mSecureBackgroundColor release]; mSecureBackgroundColor = nil;
|
||||
[mSearchString release];
|
||||
mSearchString = nil;
|
||||
|
||||
[mPopupWin release];
|
||||
mPopupWin = nil;
|
||||
|
||||
[mDataSource release];
|
||||
mDataSource = nil;
|
||||
|
||||
[mSecureBackgroundColor release];
|
||||
mSecureBackgroundColor = nil;
|
||||
|
||||
[mLock release]; mLock = nil;
|
||||
|
||||
NS_IF_RELEASE(mSession);
|
||||
|
@ -403,12 +411,15 @@ NS_IMPL_ISUPPORTS1(AutoCompleteListener, nsIAutoCompleteListener)
|
|||
|
||||
- (void) performSearch
|
||||
{
|
||||
nsAutoString searchString;
|
||||
[mSearchString assignTo_nsAString:searchString];
|
||||
nsresult rv = mSession->OnStartLookup(searchString.get(), mResults, mListener);
|
||||
|
||||
if (NS_FAILED(rv))
|
||||
NSLog(@"Unable to perform autocomplete lookup");
|
||||
if (mSession) {
|
||||
nsAutoString searchString;
|
||||
[mSearchString assignTo_nsAString:searchString];
|
||||
if (mSession == nsnull)
|
||||
NSLog(@"mSession is equal to nsnull");
|
||||
nsresult rv = mSession->OnStartLookup(searchString.get(), mResults, mListener);
|
||||
if (NS_FAILED(rv))
|
||||
NSLog(@"Unable to perform autocomplete lookup");
|
||||
}
|
||||
}
|
||||
|
||||
- (void) dataReady:(nsIAutoCompleteResults*)aResults status:(AutoCompleteStatus)aStatus
|
||||
|
|
Загрузка…
Ссылка в новой задаче