Menu

#12 Crash when deleting part

v1.0_(example)
closed-fixed
nobody
None
8
2014-04-05
2014-03-30
Ben Supnik
No
  1. Create a model with two parts.
  2. Select a part.
  3. Pick command-I for part insertion.
  4. Enter a filter string that shows no parts.
  5. Press command-I to insert anyway.
    Result so far: you are brought back to the document window, with the old part still selected.
  6. Press delete to delete the selected part.

At this point, we die in LDrawGLCamera setModelSize - for some reason the model is now zero sized?

Discussion

  • Ben Supnik

    Ben Supnik - 2014-03-30

    This is the back-trace

    • thread #1: tid = 0x147dee, 0x00000001000dc4f5 Bricksmith`-LDrawGLCamera setModelSize: + 101 at LDrawGLCamera.m:628, queue = 'com.apple.main-thread', stop reason = breakpoint 2.1
    • frame #0: 0x00000001000dc4f5 Bricksmith-[LDrawGLCamera setModelSize:](self=0x0000000104315850, _cmd=0x00000001000eb7df, inModelSize=<unavailable>) + 101 at LDrawGLCamera.m:628 frame #1: 0x000000010009e0c3 Bricksmith-LDrawGLRenderer displayNeedsUpdating: + 179 at LDrawGLRenderer.m:1873
      frame #2: 0x00007fff921e8e0c CoreFoundation__CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 12 frame #3: 0x00007fff920dca6d CoreFoundation_CFXNotificationPost + 2893
      frame #4: 0x00007fff8bba67ba Foundation-[NSNotificationCenter postNotificationName:object:userInfo:] + 68 frame #5: 0x0000000100086613 Bricksmith-LDrawDirective noteNeedsDisplay + 99 at LDrawDirective.m:816
      frame #6: 0x000000010004129e Bricksmith-[LDrawDocument outlineViewSelectionDidChange:](self=0x000000010035b030, _cmd=0x00007fff8f7a6c9e, notification=0x0000618000247710) + 910 at LDrawDocument.m:3627 frame #7: 0x00007fff921e8e0c CoreFoundationCFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER + 12
      frame #8: 0x00007fff920dca6d CoreFoundation_CFXNotificationPost + 2893 frame #9: 0x00007fff8bba67ba Foundation-[NSNotificationCenter postNotificationName:object:userInfo:] + 68
      frame #10: 0x00007fff8ee6ac0f AppKit-[NSTableView _sendSelectionChangedNotificationForRows:columns:] + 177 frame #11: 0x00007fff8ed97504 AppKit-[NSTableView _enableSelectionPostingAndPost] + 406
      frame #12: 0x0000000100039a95 Bricksmith-[LDrawDocument delete:](self=0x000000010035b030, _cmd=0x00007fff8f799ceb, sender=0x00006100000bd9a0) + 85 at LDrawDocument.m:1677 frame #13: 0x00007fff8ef49340 AppKit-[NSApplication sendAction:to:from:] + 327
      frame #14: 0x00007fff8ef642a8 AppKit-[NSMenuItem _corePerformAction] + 394 frame #15: 0x00007fff8ef63fe4 AppKit-[NSCarbonMenuImpl performActionWithHighlightingForItemAtIndex:] + 117
      frame #16: 0x00007fff8ef6315c AppKit-[NSMenu performKeyEquivalent:] + 289 frame #17: 0x00007fff8ef5f9c1 AppKit-[NSApplication _handleKeyEquivalent:] + 822
      frame #18: 0x00007fff8efceea9 AppKit-[NSWindow keyDown:] + 83 frame #19: 0x0000000100063859 Bricksmith-LDrawDocumentWindow keyDown: + 73 at LDrawDocumentWindow.m:29
      frame #20: 0x00007fff8ef2bbda AppKitforwardMethod + 122 frame #21: 0x00007fff8ef2bbda AppKitforwardMethod + 122
      frame #22: 0x00007fff8ef2bbda AppKitforwardMethod + 122 frame #23: 0x00007fff8ef2bbda AppKitforwardMethod + 122
      frame #24: 0x00007fff8ef2bbda AppKitforwardMethod + 122 frame #25: 0x00007fff8ef2bbda AppKitforwardMethod + 122
      frame #26: 0x00007fff8ef2bbda AppKitforwardMethod + 122 frame #27: 0x00007fff8ef2bbda AppKitforwardMethod + 122
      frame #28: 0x0000000100066ef8 Bricksmith-[LDrawGLView keyDown:](self=0x0000000100370fd0, _cmd=0x00007fff8f76cf79, theEvent=0x0000610000138420) + 1192 at LDrawGLView.m:1371 frame #29: 0x00007fff8ef2d65b AppKit-[NSWindow sendEvent:] + 1843
      frame #30: 0x00007fff8eecec42 AppKit-[NSApplication sendEvent:] + 3395 frame #31: 0x000000010006dc07 Bricksmith-BricksmithApplication sendEvent: + 343 at BricksmithApplication.m:71
      frame #32: 0x00007fff8ed1eb89 AppKit-[NSApplication run] + 646 frame #33: 0x00007fff8ed09913 AppKitNSApplicationMain + 940
      frame #34: 0x0000000100001aa2 Bricksmith`main(argc=3, argv=0x00007fff5fbff8b0) + 3
     
  • Ben Supnik

    Ben Supnik - 2014-03-30

    This is what appears to be going wrong: for some reason the noteNeedsDisplay method of the LDrawFile that the user is editing (hit due to the delete - an edit of the document) is triggering a displayNeedsUpdating in the part preview, whose currently displayed part is NIL, causing the call to setModelSize to have a junk box!

     
  • Ben Supnik

    Ben Supnik - 2014-04-05
    • status: open --> closed-fixed
     
  • Ben Supnik

    Ben Supnik - 2014-04-05

    Fixed with r650.

     

Log in to post a comment.