Rename the document viewer "DestroyRefCount" member and methods

RESOLVED FIXED in Firefox 59

Status

()

enhancement
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: jwatt, Assigned: jwatt)

Tracking

unspecified
mozilla59
Points:
---

Firefox Tracking Flags

(firefox59 fixed)

Details

Attachments

(1 attachment)

The methods IncrementDestroyRefCount and DecrementDestroyRefCount from nsIDocumentViewerPrint (implemented by nsDocumentViewer) are aweful. They claim that there's some sort of reference count with the implication that this reference count will actually keep objects alive. In fact they simply block/unblock the Destroy() call, and we've had serious bugs where the dtor of nsDocumentViewer objects is called, and we then end up accessing a free'd object trying to call Destroy() on it too late.

This whole system is aweful and we need to figure out how to replace it, but in the interim we should at least rename these methods so that they don't imply they're doing something they're not.
Posted patch patchSplinter Review
Attachment #8942768 - Flags: review?(bobowencode)
Attachment #8942768 - Flags: review?(bobowencode) → review+
Pushed by jwatt@jwatt.org:
https://hg.mozilla.org/integration/mozilla-inbound/rev/f3d24c21360d
Rename the document viewer "DestroyRefCount" member and methods. r=bobowen
https://hg.mozilla.org/mozilla-central/rev/f3d24c21360d
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla59
You need to log in before you can comment on or make changes to this bug.