Closed
Bug 351222
Opened 19 years ago
Closed 11 years ago
Mozilla C++ code must use smart pointers insead of raw pointers where possible
Categories
(Core :: General, defect)
Core
General
Tracking
()
RESOLVED
INCOMPLETE
People
(Reporter: ehsan.akhgari, Unassigned)
Details
(Keywords: sec-want)
When allocating dynamic storage, using raw C++ pointers instead of smart pointers which manage deallocating the resources automatically can lead to memory leak bugs such as bug #337763, especially if another developer edits that code later and does not pay enough attention to the code that is already in place.
Using smart pointer classes like nsAutoPtr<T> and nsAutoArrayPtr<T> would benefit this problem by automating the deallocation of the storage, and such code is immune to the mentioned memory leak bugs.
Changing raw pointers to smart pointers is a huge task, and I'm reporting this bug in the hope that other developers who are more familiar with the structure of bugzilla and mozilla source code would help dividing it to smaller bugs for each component, and reviewing code and fixing it gradually.
Updated•19 years ago
|
Assignee: general → nobody
Product: Mozilla Application Suite → Core
QA Contact: general → general
Comment 1•11 years ago
|
||
I agree with the sentiment, but this 8 year old bug doesn't really seem to be helping anything. :)
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → INCOMPLETE
You need to log in
before you can comment on or make changes to this bug.
Description
•