Closed Bug 70489 Opened 24 years ago Closed 24 years ago

[BeOS] window objects leak

Categories

(Core :: XUL, defect)

x86
BeOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: VYA04230, Assigned: ykoehler)

Details

Attachments

(1 file)

Current BeOS build leaks many window objects. I created a patch to fix it. *** HOW TO REPRODUCE ** Here is the sitiations that the leak occurs. Case A1. close a dialog by pushing 'close' or 'ok' button : nsWindow object and nsWindowBeOS(=BWindow) always leaks. Case A2. close a top-level-window by Selecting Menubar->File->Close : nsWindow object and nsWindowBeOS(=BWindow) always leaks. Here is some sitiations that the leak NOT occurs. Case B1. close a dialog by pushing a tiny box (BeOS specific) on upper-left corner of the dialog window : no leak Case B2. close a top-level-window by pushing a tiny box (BeOS specific) on upper-left corner of the window : no leak #BWindow leak can be viewed by watching threads. *** CAUSE OF THE LEAK *** In Case A1&A2, nsWindow object was not deleted because it has a BeOS native object which holds a reference count to the nsWindow object. The BeOS native object (nsWindowBeOS) inherites nsIWidgetStore, which actually ADDREF/RELEASE nsWindow object. *** WHAT I DONE IN THE PATCH *** What I done is to change nsIWidgetStore not to hold a reference count to nsWindow. So, the leak will not occur anymore. And nsIWidgetStore should only be used for nsWindow's internal object from now on. *** WHAT I DONE IN THE PATCH PART TWO *** Along with that, I modified nsWindowBeOS::QuitRequested() to not return 'true'. If the function returns 'true', it means that app_server will delete the nsWindowBeOS object soon, maybe before nsWindow kills it. I think nsWindowBeOS object should not die where its owner(nsWindow object) don't know, so nsWindowBeOS should not kill itself by returning 'true' on QuitRequested() , but tell nsWindow to 'kill me' and wait for a while. Also, I found a leak in nsWindow::DispatchMouseEvent() and fix it. *** AFFECTED FILES *** /widget/src/beos/nsWindow.cpp
fixes confirmed
committed. marking fixed
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: