Re: Why is the latest WebKit interacting with my NSThread?

  • > Since upgrading to 10.4.11 and Safari 3, I notice now that a thread in my
    > application throws the following errors when an NSThread thread runs:
    >
    > WebKit Threading Violation - +[DOMDocument(WebCoreInternal)
    > _wrapDocument:]
    > called from secondary thread
    >
    > WebKit Threading Violation - +[DOMCSSStyleDeclaration(WebCoreInternal)
    > _wrapCSSStyleDeclaration:] called from secondary thread
    >
    > WebKit Threading Violation - -[DOMCSSValue dealloc] called from secondary
    > thread
    >
    > WebKit Threading Violation - -[DOMNode dealloc] called from secondary
    > thread

    Well after experimenting for  a bit longer after posting this, I found the
    problem: I was calling

    [[[NSAttributedString alloc] initWithHTML:theData documentAttributes:nil]
    autorelease]

    in a thread, and apparently it's now not thread-safe (or maybe it never
    was). Moving this outside of my thread resolved the problem. This call must
    be accessing WebKit, which I guess sort of makes sense, but I wouldn't have
    expected an NSAttributedString dependancy on WebKit.
  • On Dec 7, 2007, at 4:57 AM, Michael Dupuis wrote:

    > Well after experimenting for  a bit longer after posting this, I
    > found the
    > problem: I was calling
    >
    > [[[NSAttributedString alloc] initWithHTML:theData
    > documentAttributes:nil]
    > autorelease]
    >
    >
    > in a thread, and apparently it's now not thread-safe (or maybe it
    > never
    > was). Moving this outside of my thread resolved the problem. This
    > call must
    > be accessing WebKit, which I guess sort of makes sense, but I
    > wouldn't have
    > expected an NSAttributedString dependancy on WebKit.

    This is documented in the AppKit release notes.  The behavior has
    changed somewhat from release to release, so look at both the Tiger
    and the Leopard release notes.

    Douglas Davidson
previous month december 2007 next month
MTWTFSS
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31            
Go to today