Closed
Bug 1263503
Opened 10 years ago
Closed 8 years ago
memory leak of filename into layout/printing/nsPrintEngine.cpp
Categories
(Core :: Printing: Output, defect, P4)
Tracking
()
RESOLVED
FIXED
mozilla57
People
(Reporter: m_kato, Assigned: m_kato)
Details
(Keywords: memory-leak)
Attachments
(1 file)
https://dxr.mozilla.org/mozilla-central/source/layout/printing/nsPrintEngine.cpp#1682
nsAutoString fileNameStr;
// check to see if we are printing to a file
bool isPrintToFile = false;
mPrt->mPrintSettings->GetPrintToFile(&isPrintToFile);
if (isPrintToFile) {
// On some platforms The BeginDocument needs to know the name of the file.
char16_t* fileName = nullptr;
mPrt->mPrintSettings->GetToFileName(&fileName);
fileNameStr = fileName;
}
"fileNameStr = fileName;" will be fileNameStr.Assign(fileName). So we should use Adopt, "nsXPIDLString fileNameStr", or AString parameter instead.
Updated•10 years ago
|
| Comment hidden (mozreview-request) |
Comment 2•8 years ago
|
||
| mozreview-review | ||
Comment on attachment 8906425 [details]
Bug 1263503 - memory leak of filename into layout/printing/nsPrintEngine.cpp.
https://reviewboard.mozilla.org/r/178138/#review183098
Thanks!
Comment 3•8 years ago
|
||
| mozreview-review | ||
Comment on attachment 8906425 [details]
Bug 1263503 - memory leak of filename into layout/printing/nsPrintEngine.cpp.
https://reviewboard.mozilla.org/r/178140/#review183102
Attachment #8906425 -
Flags: review?(mantaroh) → review+
Pushed by m_kato@ga2.so-net.ne.jp:
https://hg.mozilla.org/integration/autoland/rev/5ea257c32084
memory leak of filename into layout/printing/nsPrintEngine.cpp. r=mantaroh
Comment 5•8 years ago
|
||
| bugherder | ||
Status: NEW → RESOLVED
Closed: 8 years ago
status-firefox57:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
Comment 6•8 years ago
|
||
How severe is this leak? Is this something we should consider backporting to 56 or can it ride the 57 train?
Assignee: nobody → m_kato
Blocks: 1156742
status-firefox55:
--- → wontfix
status-firefox56:
--- → affected
status-firefox-esr52:
--- → wontfix
Flags: needinfo?(m_kato)
Version: unspecified → 47 Branch
| Assignee | ||
Comment 7•8 years ago
|
||
(In reply to Ryan VanderMeulen [:RyanVM] from comment #6)
> How severe is this leak? Is this something we should consider backporting to
> 56 or can it ride the 57 train?
This is small memory leak and this occurs when using [Print] - [Save as File]. Most users don't use this.
Flags: needinfo?(m_kato)
Updated•8 years ago
|
Comment 8•8 years ago
|
||
While I moved the pointer declaration in bug 1156742 (and should have spotted it :-) ), this leak has been there for over 15 years.
No longer blocks: 1156742
Version: 47 Branch → 1.0 Branch
You need to log in
before you can comment on or make changes to this bug.
Description
•