[Webkit-unassigned] [Bug 96201] [EFL][WK2] WKEinaSharedString needs a function to adopt eina stringshare.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Sep 11 00:53:24 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=96201





--- Comment #26 from Byungwoo Lee <bw80.lee at samsung.com>  2012-09-11 00:53:46 PST ---
(In reply to comment #25)
> (From update of attachment 163110 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=163110&action=review
> 
> > Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_eina_shared_string.cpp:87
> > +    WKEinaSharedString string(WKEinaSharedString::adopt(eina_stringshare_add(testString)));
> > +    checkString(string, testString);
> > +
> > +    string = WKEinaSharedString::adopt(eina_stringshare_add(anotherTestString));
> > +    checkString(string, anotherTestString);
> > +
> > +    string = string;
> > +    checkString(string, anotherTestString);
> 
> Why not test that the first one got free'd?
Yes, I want to test it, but I think there is no way to verify whether the first one got free'd or not, because there is no api to get the reference count for the eina_stringshare, and accessing free'd eina_stringshare can make segmentation fault according to the eina_stringshare.h

The thing that we can get from this test case is that,
eina_stringshare_del() function in WKEinaSharedString destructor will not make a segmentation fault even if we created it by adopting eina_stringshare directly (without eina_stringshare_ref()).

With this, I can think that the eina_stringshare that adopted by WKEinaSharedString will be deallocated by it's destructor.

-- 
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