New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not call -[setMenu: nil] from -[dealloc] #137
Conversation
... bc it just clears non-retained _menuView which belongs to a superlass
631dde9
to
f7f0320
Compare
... _menuItem can be assigned to a NSMenuItem regardless of _menu e.g. -[drawInteriorWithFrame:inView:]
... the superclass NSCell tries to release _menu too TEST_RELEASE
so _menu must be set to nil
|
I am testing this a bit. I only have vague memories about the bug that led to the original commit you are essentially reverting. but it was very hard to reproduce, but in case consistent. I think it had to do with popupmenus with certain themes or so. You do add Also, the bug on savannah reports by Yavor a "works for me" comment on Fred's work... so is a fix still needed? |
|
The issue is gone |
|
Excellent, thanks for the check, because I was trying to do some tests and failed to reproduce. |
https://savannah.gnu.org/bugs/?61727
That one issue in December was due to deallocation of NSPopUpButtonCell
causing to call -[synchronizeTitleAndSelectedItem] followed with updating
of the _menuItem, its _menu and all dependants (validators) where
the segfault occurs because one of the validators has been deallocated already.
#0 0x00007ffff6ee9415 in objc_msg_lookup () from /usr/lib/x86_64-linux-gnu/libobjc.so.4
#1 0x00007ffff7845af0 in -[NSApplication targetForAction:to:from:] (self=0x5555559683a0, _cmd=0x7ffff7c72330 <_OBJC_SELECTOR_TABLE+2384>,
theAction=0x555555ad8570, theTarget=0x555555e464b0, sender=0x555555d1feb0) at NSApplication.m:2294
#2 0x00007ffff7949ca8 in -[NSMenu _autoenableItem:] (self=0x555555d1fa40, _cmd=0x7ffff7c723f0 <_OBJC_SELECTOR_TABLE+2576>,
item=0x555555d1feb0) at NSMenu.m:1184
#3 0x00007ffff794a078 in -[NSMenu update] (self=0x555555d1fa40, _cmd=0x7ffff7c721a0 <_OBJC_SELECTOR_TABLE+1984>) at NSMenu.m:1260
#4 0x00007ffff7948f56 in -[NSMenu itemChanged:] (self=0x555555d1fa40, _cmd=0x7ffff7c79650 <_OBJC_SELECTOR_TABLE+496>,
anObject=0x555555d1fdd0) at NSMenu.m:878
#5 0x00007ffff7957bdd in -[NSMenuItem setImage:] (self=0x555555d1fdd0, _cmd=0x7ffff7c98cf0 <_OBJC_SELECTOR_TABLE+1168>, image=0x0)
at NSMenuItem.m:375
#6 0x00007ffff797c589 in -[NSPopUpButtonCell setMenuItem:] (self=0x555555d1fc60, _cmd=0x7ffff7c98da0 <_OBJC_SELECTOR_TABLE+1344>, item=0x0)
at NSPopUpButtonCell.m:652
#7 0x00007ffff797cf77 in -[NSPopUpButtonCell synchronizeTitleAndSelectedItem] (self=0x555555d1fc60,
_cmd=0x7ffff7c98ac0 <_OBJC_SELECTOR_TABLE+608>) at NSPopUpButtonCell.m:854
#8 0x00007ffff797b631 in -[NSPopUpButtonCell setMenu:] (self=0x555555d1fc60, _cmd=0x7ffff7c98940 <_OBJC_SELECTOR_TABLE+224>, menu=0x0)
at NSPopUpButtonCell.m:218
#9 0x00007ffff797b284 in -[NSPopUpButtonCell dealloc] (self=0x555555d1fc60, _cmd=0x7ffff7534970 <_OBJC_SELECTOR_TABLE+48>)
at NSPopUpButtonCell.m:153
May be doing that is excessive in the context of deallocation?