[webkit-help] Why JSEventListener::m_wrapper has been freed ?

Y.Sanachan sanachan.y at gmail.com
Wed Dec 21 07:41:38 PST 2011

Hi there,

I am using WebKit based browser with JSC, and would like to add a new event
like onStateChanged using DEFINE_ATTRIBUTE_EVENT_LISTENER() macro.

Sometimes an event was dispatched correctly and it reached to JS
but sometimes not dispatched caused by JSEventListener::jsFunction()
returns 0 (at JSEventListener::handleEvent()).
The verification failed in JSEventListener::jsFunction().
At that, there is a comment as :

// Verify that we have a valid wrapper protecting our function from
// garbage collection.
if (!m_wrapper)
return 0;

Then I have a few questions as below.
1. How to block garbage collection to free m_wrapper ?
GCController seems to just collect heap without any conditions.
2. Is it possible to recover/recreate m_wrapper as like as
JSLazyEventListener::initializeJSFunction() ?

Please help me.


More information about the webkit-help mailing list