Closed Bug 882 Opened 26 years ago Closed 26 years ago

nsButton not initializing mRefCnt

Categories

(Core :: Layout: Form Controls, defect, P1)

x86
Windows NT
defect

Tracking

()

VERIFIED FIXED

People

(Reporter: troy, Assigned: kmcclusk)

Details

Kevin, Purify is complaining that the nsButton AddRef() member function is making an uninitialized memory reference to mRefCnt. That's because the Windows version of nsButton.h uses NS_DECL_ISUPPORTS which gets a mRefCnt member data declared, but the constructor doesn't use NS_INIT_REFCNT() to initialize the member data I would have added that, but that isn't sufficient because nsBaseWidget also uses NS_DECL_ISUPPORTS which means that nsButton really has two mRefCnt member data. That's bad and needs to be fixed Troy
Status: NEW → RESOLVED
Closed: 26 years ago
Resolution: --- → FIXED
Stopped using NS_DECL_ISUPPORTS macro on any Windows widget that derives From nsBaseWidget.h. This removes the mRefCnt member variable defined through the NS_DECL_ISUPPORTS macro. This problem was not confined to nsButton.h. I also Modified nsCheckButton.h, nsComboBox.h, nsDialog.h, nsLabel.h, nsListBox.h, nsRadioButton.h since they all used NS_DECL_ISUPPORTS and derived from nsBaseWidget. -- Kevin
Summary: nsButton not initializing mRefCnt → nsButton not initializing mRefCnt
[Pinged Troy by E-mail to request bug verification, since this is too deeply at the code-level to be able to verify.]
troy can you please verify -- thanks
Troy provide a test case for verification
QA Contact: 4015
Status: RESOLVED → VERIFIED
based on discussion with Troy, marking bug as verified.
Moving all Widget Set bugs, past and present, to new HTML Form Controls component per request from karnaze. Widget Set component will be retired shortly.
You need to log in before you can comment on or make changes to this bug.