If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

[BeOS] window objects leak

RESOLVED FIXED

Status

()

Core
XUL
RESOLVED FIXED
17 years ago
17 years ago

People

(Reporter: Makoto Hamanaka, Assigned: Yannick Koehler)

Tracking

Trunk
x86
BeOS
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

17 years ago
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
(Reporter)

Comment 1

17 years ago
Created attachment 26421 [details] [diff] [review]
patch (diff -u) to /widget/src/beos/nsWindow.cpp

Comment 2

17 years ago
fixes confirmed

Comment 3

17 years ago
r=guru@startrek.com

Comment 4

17 years ago
committed. marking fixed
Status: NEW → RESOLVED
Last Resolved: 17 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.