зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1331321 - Free |docTitles| without allocate when printing on MacOS. r=mstange
This commit is contained in:
Родитель
3dde1a2f1c
Коммит
86ad9dd370
|
@ -50,15 +50,17 @@ nsPrintOptionsX::SerializeToPrintData(nsIPrintSettings* aSettings,
|
|||
char16_t** docTitles;
|
||||
uint32_t titleCount;
|
||||
rv = aWBP->EnumerateDocumentNames(&titleCount, &docTitles);
|
||||
if (NS_SUCCEEDED(rv) && titleCount > 0) {
|
||||
data->printJobName().Assign(docTitles[0]);
|
||||
}
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
if (titleCount > 0) {
|
||||
data->printJobName().Assign(docTitles[0]);
|
||||
}
|
||||
|
||||
for (int32_t i = titleCount - 1; i >= 0; i--) {
|
||||
free(docTitles[i]);
|
||||
for (int32_t i = titleCount - 1; i >= 0; i--) {
|
||||
free(docTitles[i]);
|
||||
}
|
||||
free(docTitles);
|
||||
docTitles = nullptr;
|
||||
}
|
||||
free(docTitles);
|
||||
docTitles = nullptr;
|
||||
}
|
||||
|
||||
RefPtr<nsPrintSettingsX> settingsX(do_QueryObject(aSettings));
|
||||
|
|
Загрузка…
Ссылка в новой задаче