From d4602651a8eaaddfa19f2b54a12578bca3005d9b Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Tue, 19 Nov 2024 02:38:20 +1100 Subject: debugger/osx: Don't use uninitialised NSRect when creating pop-up button. The initial size doesn't really matter because the pop-up button is resized before being added to the container that holds it and the expression field. The disassembly viewer apparently wasn't updated properly like the memory viewer when the auto-sizing code was refactored. Hopefully this will fix the debugger crashing when restoring window positions from configuration (although I would have thought this would cause crashes in more situations if it was the cause of that). --- src/osd/modules/debugger/osx/disassemblyviewer.mm | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/osd/modules/debugger/osx/disassemblyviewer.mm b/src/osd/modules/debugger/osx/disassemblyviewer.mm index 20ec457f628..a0659c00cfc 100644 --- a/src/osd/modules/debugger/osx/disassemblyviewer.mm +++ b/src/osd/modules/debugger/osx/disassemblyviewer.mm @@ -45,9 +45,7 @@ [expressionField sizeToFit]; // create the subview popup - subviewButton = [[NSPopUpButton alloc] initWithFrame:NSOffsetRect(expressionFrame, - expressionFrame.size.width, - 0)]; + subviewButton = [[NSPopUpButton alloc] initWithFrame:NSMakeRect(0, 0, 100, 19)]; [subviewButton setAutoresizingMask:(NSViewWidthSizable | NSViewMinXMargin | NSViewMinYMargin)]; [subviewButton setBezelStyle:NSBezelStyleShadowlessSquare]; [subviewButton setFocusRingType:NSFocusRingTypeNone]; -- cgit v1.2.3