Closed Bug 343643 Opened 18 years ago Closed 18 years ago

Inconsistent casting of nsIObserver to nsISupports may lead to object leaks

Categories

(Core Graveyard :: Embedding: GRE Core, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: mikhail.zabaluev, Assigned: mikhail.zabaluev)

Details

(Keywords: memory-leak)

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.8.0.4) Gecko/20060508 Firefox/1.5.0.4
Build Identifier: Xulrunner trunk

In nsCommandManager, there is an inconsistency between AddCommandObserver and RemoveCommandObserver in how the object passed as nsIObserver is casted to nsISupports to do operations on the observer array. In the former, it's a QI, but the latter uses an implicit static cast. This, depending on the observer's interface map, may lead to spurious failures of RemoveCommandObserver and object leaks.

Reproducible: Always
Assignee: nobody → mhz
Status: UNCONFIRMED → NEW
Ever confirmed: true
Attachment #228146 - Flags: superreview+
Attachment #228146 - Flags: review+
Fix checked in.  Thanks for the patch!
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Keywords: mlk
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: