Convert nsConsoleService member-variable "mMessages" to use smart pointers for safety

NEW
Unassigned

Status

()

Core
XPCOM
3 years ago
3 years ago

People

(Reporter: dholbert, Unassigned)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(firefox43 affected)

Details

(Reporter)

Description

3 years ago
nsConsoleService has a member-variable...
  nsIConsoleMessage** mMessages;
...whose members we NS_ADDREF and NS_RELEASE manually as we modify the array:
http://mxr.mozilla.org/mozilla-central/search?string=NS_ADDREF&find=nsConsoleService
http://mxr.mozilla.org/mozilla-central/search?string=NS_RELEASE&find=nsConsoleService


We should use smart pointers here instead, to manage the refcount for us and avoid accidental mis-addref'ing. (This member-variable should really have type nsCOMArray<nsIConsoleMessage>, or nsTArray<nsCOMPtr<nsIConsoleMessage>>.)
You need to log in before you can comment on or make changes to this bug.