[webkit-reviews] review denied: [Bug 107778] Objective-C API: JSContext exception property causes reference cycle : [Attachment 185638] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jan 31 10:42:36 PST 2013


Oliver Hunt <oliver at apple.com> has denied Mark Hahnenberg
<mhahnenberg at apple.com>'s request for review:
Bug 107778: Objective-C API: JSContext exception property causes reference
cycle
https://bugs.webkit.org/show_bug.cgi?id=107778

Attachment 185638: Patch
https://bugs.webkit.org/attachment.cgi?id=185638&action=review

------- Additional Comments from Oliver Hunt <oliver at apple.com>
View in context: https://bugs.webkit.org/attachment.cgi?id=185638&action=review


> Source/JavaScriptCore/API/JSContext.mm:45
> +    JSValueRef m_exception;

Make this Strong<> or ProtectedPtr<>

> Source/JavaScriptCore/API/JSContext.mm:100
> +    if (m_exception)
> +	   JSValueUnprotect(m_context, m_exception);
> +
> +    if (value) {
> +	   m_exception = valueInternalValue(value);
> +	   JSValueProtect(m_context, m_exception);
> +    } else
> +	   m_exception = 0;

This becomes much simpler if m_exception is simply a Strong or ProtectedPtr --
I assume we'd prefer Strong<> these days but maybe i'm wrong?

> Source/JavaScriptCore/API/JSContext.mm:107
> +    if (m_exception)
> +	   return [JSValue valueWithValue:m_exception inContext:self];
> +	return nil;

Formatting horror!


More information about the webkit-reviews mailing list