Opened 6 years ago

Closed 6 years ago

#9481 closed bug (fixed)

[patch] BMenuBar_Track() is not locking atomically

Reported by: jscipione Owned by: axeld
Priority: high Milestone: R1
Component: Kits/Interface Kit Version: R1/Development
Keywords: Cc:
Blocked By: Blocking: #8539
Has a Patch: yes Platform: All

Description (last modified by jscipione)

Because the locking is not-atomic it can cause the app to crash if another thread detaches the menu bar from the window while this method is trying to use it.

The attached patch fixes the problem for me and I detect no regressions but I'd like someone to take a second look. It was discovered while I was attempting to fix #8539 and is (partially) responsible for causing that bug.

Can someone with experience with BMenuBar and BHandler/BLooper take a look at my patch and see if there are any problems with it?

Attachments (1)

0001-Use-LockLooper-in-BMenuBar-_Track-which-is-atomic.patch (2.9 KB) - added by jscipione 6 years ago.
Patch that replaces window->(Un)Lock() with (Un)LockLooper()

Download all attachments as: .zip

Change History (5)

Changed 6 years ago by jscipione

Patch that replaces window->(Un)Lock() with (Un)LockLooper()

comment:1 Changed 6 years ago by jscipione

Has a Patch: set

comment:2 Changed 6 years ago by jscipione

Description: modified (diff)

comment:3 Changed 6 years ago by hamish

This change looks good to me.

The Window() == NULL check on 575 can now be eliminated, as LockLooper() accomplishes this for you.

comment:4 Changed 6 years ago by jscipione

Resolution: fixed
Status: newclosed

Fixed in hrev45340

Note: See TracTickets for help on using tickets.