#10885: [PowerStatus] crashes Deskbar
----------------------------------------+----------------------------
Reporter: diver | Owner: axeld
Type: bug | Status: new
Priority: normal | Milestone: R1
Component: Applications/PowerStatus | Version: R1/Development
Resolution: | Keywords:
Blocked By: | Blocking:
Has a Patch: 0 | Platform: All
----------------------------------------+----------------------------
Comment (by gbl08ma):
After some experimentation, it seems the crash occurs because the
PowerStatusReplicant destructor stops and releases the reference of the
DriverInterface while the extended battery info window is still using it.
If _Quit() is modified to always close the battery information window
before removing the replicant from the deskbar, the deskbar no longer
crashes under the specified conditions.
However, with this modification, PowerStatus still crashes in a different
situation, presumably for the same reason. Steps to reproduce:
1. Open the PowerStatus applet and specify to '''Run in window'''
2. Drag, using the bottom-right corner, the replicant to the desktop
3. Close the PowerStatus window (not the replicant)
4. Right-click the battery icon on the replicant and select "Battery
info...", leave the window open.
5. Right-click the dragger on the bottom-right of the replicant and select
"Remove replicant.". The Tracker will crash.
I'm not sure how to solve this last problem as _Quit() is not called in
this situation (in fact, using the "Quit" option provided by PowerStatus
won't work when it is a stand-alone replicant). Perhaps some message (that
is not B_QUIT_REQUESTED) will be sent to the replicant before it is
closed, or the code I added to close the window can be safely moved to the
destructor?
I'll submit a patch but it is certainly not the ideal solution.
--
Ticket URL: <https://dev.haiku-os.org/ticket/10885#comment:2>
Haiku <https://dev.haiku-os.org>
Haiku - the operating system.