[Webkit-unassigned] [Bug 89186] [EFL][WK2] Add APIs to create, delete and get ewk_context.
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Thu Jul 12 22:55:59 PDT 2012
https://bugs.webkit.org/show_bug.cgi?id=89186
--- Comment #13 from EunMi Lee <eunmi15.lee at samsung.com> 2012-07-12 22:55:58 PST ---
(In reply to comment #12)
> (From update of attachment 149910 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=149910&action=review
>
> >>> Source/WebKit2/UIProcess/API/efl/ewk_context.cpp:35
> >>> + _Ewk_Context(WKRetainPtr<WKContextRef> contextRef)
> >>
> >> Why this change?
> >
> > We have to use adoptWK() here because WKContextCreate() returns leakPtr(),
> > and we have to get that using WKRetainPtr in the line 35 to prevent memory leak.
>
> It is already assigned to context which is a WKRetainPtr<WKContextRef>, so I did not think there was a leak here. Are you sure?
>
I think my sentence caused the confusion. I can explain again.
I use the adoptWK() to prevent leak because WKContextCreate() returns leakPtr(), so the leak problem is fixed here.
and, I change the _Ewk_Context()'s parameter to WKRetainPtr because adoptWK() returns WKRetainPtr type. but I can use WKContextRef if I return the adoptWK(...).get() istead of adoptWK(...).
So, do you want that?
> >>> Source/WebKit2/UIProcess/API/efl/ewk_context.cpp:65
> >>> +Eina_Bool ewk_context_free(Ewk_Context* ewkContext)
> >>
> >> Our *_free() functions usually don't return a boolean I believe.
> >
> > Actually, there is a matter for ewk_view when we free ewk_context directly even though there is no matter for WKContext.
> > Suppose that there is a ewk_view which has a reference of ewk_context,
> > it will have the freed memory's reference if we free the ewk_context whenever ewk_context_free() is called.
> > So, I want to check that there is a reference of ewk_context or not by using WKContext's refCount because ewk_context and WKContext have the same reference count.
>
> So I would prefer if we had "ewk_context_ref() / ewk_context_unref()" function and if we had a reference counter in the struct, like we do already for several other Ewk types.
Yes, I use the WKContext's refCount for my convenience but I think ewk_context_ref()/unref() is better now. that is more explicit. :)
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list