зеркало из https://github.com/mozilla/pjs.git
Fix memory leak. Bug 296019, r=mconnor, a=shaver
This commit is contained in:
Родитель
b012cf951d
Коммит
cad8673b0c
|
@ -4176,9 +4176,9 @@ nsGlobalHistory::StartSearch(const nsAString &aSearchString,
|
||||||
|
|
||||||
NS_ENSURE_SUCCESS(OpenDB(), NS_ERROR_FAILURE);
|
NS_ENSURE_SUCCESS(OpenDB(), NS_ERROR_FAILURE);
|
||||||
|
|
||||||
nsIAutoCompleteMdbResult *result = nsnull;
|
nsCOMPtr<nsIAutoCompleteMdbResult> result;
|
||||||
if (aSearchString.IsEmpty()) {
|
if (aSearchString.IsEmpty()) {
|
||||||
AutoCompleteTypedSearch(&result);
|
AutoCompleteTypedSearch(getter_AddRefs(result));
|
||||||
} else {
|
} else {
|
||||||
// if the search string is empty after it has had prefixes removed, then
|
// if the search string is empty after it has had prefixes removed, then
|
||||||
// we need to ignore the previous result set
|
// we need to ignore the previous result set
|
||||||
|
@ -4194,7 +4194,10 @@ nsGlobalHistory::StartSearch(const nsAString &aSearchString,
|
||||||
AutoCompleteGetExcludeInfo(filtered, &exclude);
|
AutoCompleteGetExcludeInfo(filtered, &exclude);
|
||||||
|
|
||||||
// perform the actual search here
|
// perform the actual search here
|
||||||
nsresult rv = AutoCompleteSearch(filtered, &exclude, NS_STATIC_CAST(nsIAutoCompleteMdbResult *, aPreviousResult), &result);
|
nsresult rv = AutoCompleteSearch(filtered, &exclude,
|
||||||
|
NS_STATIC_CAST(nsIAutoCompleteMdbResult *,
|
||||||
|
aPreviousResult),
|
||||||
|
getter_AddRefs(result));
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4289,7 +4292,7 @@ nsGlobalHistory::AutoCompleteSearch(const nsAString &aSearchString,
|
||||||
aPrevResult->RemoveValueAt(i, PR_FALSE);
|
aPrevResult->RemoveValueAt(i, PR_FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
*aResult = aPrevResult;
|
NS_ADDREF(*aResult = aPrevResult);
|
||||||
} else {
|
} else {
|
||||||
// Search through the entire history
|
// Search through the entire history
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче