Closed Bug 1430686 Opened 2 years ago Closed 2 years ago

Rename the document viewer "DestroyRefCount" member and methods

Categories

(Core :: Printing: Setup, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla59
Tracking Status
firefox59 --- fixed

People

(Reporter: jwatt, Assigned: jwatt)

Details

Attachments

(1 file)

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.
Attached 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.