Closed Bug 1142695 Opened 5 years ago Closed 2 years ago

Consider making Mutex, OffTheBooksMutex, BlockingResourceBase's dtors virtual

Categories

(Core :: XPCOM, defect)

x86_64
Linux
defect
Not set

Tracking

()

RESOLVED WONTFIX

People

(Reporter: erahm, Unassigned)

References

(Blocks 1 open bug)

Details

(Keywords: coverity, Whiteboard: [MemShrink:P3][CID 1286381])

Coverity indicated a potential leak if an upcast pointer from a Mutex is deleted, Mutex's dtor would not be hit, ie something like:

> void killer(OffTheBooksMutex* b) { delete b; }
> Mutex* a = new Mutex("test");
> killer(a);

While it doesn't appear that this is currently happening (the instance Coverity flagged looks like a bug in Coverity), it certainly *could*.
Since these classes don't have virtual methods currently, I really don't think we should pay the vtable penalty for this.
Whiteboard: [MemShrink][CID 1286381] → [MemShrink:P3][CID 1286381]
(In reply to Benjamin Smedberg from comment #1)
> Since these classes don't have virtual methods currently, I really don't
> think we should pay the vtable penalty for this.

Yup.
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.