Closed
Bug 1244466
Opened 9 years ago
Closed 9 years ago
Stop using nsAutoPtr for holding primitive arrays in MailNews due to bug 1241901
Categories
(Thunderbird :: General, defect)
Thunderbird
General
Tracking
(Not tracked)
RESOLVED
FIXED
Thunderbird 47.0
People
(Reporter: jorgk-bmo, Assigned: jorgk-bmo)
References
Details
Attachments
(1 file, 2 obsolete files)
2.32 KB,
patch
|
jcranmer
:
review+
|
Details | Diff | Splinter Review |
Looks like this
https://hg.mozilla.org/mozilla-central/rev/673a9080e14d
broke the compile at least here:
c:\mozilla-source\comm-central\obj-i686-pc-mingw32\dist\include\nsAutoPtr.h(26) : error C2338: If you are using nsAutoPtr to hold an array, use UniquePtr<T[]> instead
c:/mozilla-source/comm-central/mailnews/base/src/nsMessenger.cpp(154) : see reference to class template instantiation 'nsAutoPtr<char>' being compiled
Assignee | ||
Comment 1•9 years ago
|
||
I derived the fix looking at
https://hg.mozilla.org/mozilla-central/rev/673a9080e14d#l7.49
I've also tried:
-#include "nsAutoPtr.h"
+#include "mozilla/UniquePtr.h"
- nsAutoPtr<char> m_dataBuffer;
+ mozilla::UniquePtr<char[]> m_dataBuffer;
- m_dataBuffer = new char[FOUR_K];
+ m_dataBuffer = mozilla::MakeUnique<char[]>(FOUR_K);
but that gave all sorts of hassle where m_dataBuffer is passed as a char*.
Luckily there is only one occurrence in the whole C-C tree of this.
Assignee | ||
Comment 2•9 years ago
|
||
Actually, this needs to change, too: if (m_dataBuffer && m_outputStream)
Assignee | ||
Comment 3•9 years ago
|
||
More tweaks. Sorry.
Attachment #8714015 -
Attachment is obsolete: true
Attachment #8714015 -
Flags: review?(Pidgeot18)
Attachment #8714018 -
Flags: review?(Pidgeot18)
Updated•9 years ago
|
Depends on: 1241901
Summary: Bustage of 30 Jan 2016 due to bug 1241901 → Stop using nsAutoPtr for holding primitive arrays in MailNews due to bug 1241901
Comment 4•9 years ago
|
||
(In reply to Jorg K (GMT+1) from comment #1)
> but that gave all sorts of hassle where m_dataBuffer is passed as a char*.
You probably should replace all of them with m_dataBuffer.get() rather than inline a 4k array in the class.
Assignee | ||
Comment 5•9 years ago
|
||
Attachment #8714024 -
Flags: review?(Pidgeot18)
Assignee | ||
Comment 6•9 years ago
|
||
Kent, perhaps you can get to this before Joshua. BTW, the second patch was inspired by
https://hg.mozilla.org/mozilla-central/rev/673a9080e14d#l4.32
Flags: needinfo?(rkent)
Comment 7•9 years ago
|
||
Comment on attachment 8714018 [details] [diff] [review]
Bustage fix (v2).
Review of attachment 8714018 [details] [diff] [review]:
-----------------------------------------------------------------
This one looks better.
Attachment #8714018 -
Flags: review?(Pidgeot18) → review+
Updated•9 years ago
|
Attachment #8714024 -
Flags: review?(Pidgeot18)
Comment 8•9 years ago
|
||
https://hg.mozilla.org/comm-central/rev/de29414d264853d08ced88a2b416107b18b31607
Bug 1244466 - Port Bug 1241901 part 4 - Stop using nsAutoPtr for holding primitive arrays. r=jcranmer a=aleth CLOSED TREE
Updated•9 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 47.0
Updated•9 years ago
|
Flags: needinfo?(rkent)
Attachment #8714024 -
Attachment is obsolete: true
You need to log in
before you can comment on or make changes to this bug.
Description
•