Bug 104113

Summary: [EFL][WK2] Context clients should unregister themselves when destroyed
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: WebKit EFLAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: gyuyoung.kim, jinwoo7.song, kenneth, lucas.de.marchi, rakuco, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 103692    
Attachments:
Description Flags
Patch none

Description Chris Dumez 2012-12-05 04:14:52 PST
We get crashes after a Ewk_Context is destroyed because the corresponding client classes get destroyed but they don't unregister their callbacks. As a consequence, the client callbacks sometimes get called after the client objects have been destroyed and it causes crashes.

We should make sure all our client classes unregister their callbacks in their class destructor.
Comment 1 Chris Dumez 2012-12-05 04:30:41 PST
Created attachment 177726 [details]
Patch
Comment 2 Kenneth Rohde Christiansen 2012-12-05 04:33:17 PST
Comment on attachment 177726 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=177726&action=review

> Source/WebKit2/UIProcess/efl/ContextHistoryClientEfl.cpp:137
> +    m_context->initializeHistoryClient(0);

hmm maybe we should rename to not be called initialize then, and use setHistoryClient
Comment 3 Chris Dumez 2012-12-05 05:00:24 PST
(In reply to comment #2)
> (From update of attachment 177726 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=177726&action=review
> 
> > Source/WebKit2/UIProcess/efl/ContextHistoryClientEfl.cpp:137
> > +    m_context->initializeHistoryClient(0);
> 
> hmm maybe we should rename to not be called initialize then, and use setHistoryClient

Well, the corresponding C API is WKContextSetHistoryClient() so I tend to agree with you.

However, I believe this should be done in a separate patch and we will need to CC Andersca.

For now, what matters is that we get the crashes fixed.
Comment 4 Chris Dumez 2012-12-06 04:57:44 PST
(In reply to comment #3)
> (In reply to comment #2)
> > (From update of attachment 177726 [details] [details])
> > View in context: https://bugs.webkit.org/attachment.cgi?id=177726&action=review
> > 
> > > Source/WebKit2/UIProcess/efl/ContextHistoryClientEfl.cpp:137
> > > +    m_context->initializeHistoryClient(0);
> > 
> > hmm maybe we should rename to not be called initialize then, and use setHistoryClient
> 
> Well, the corresponding C API is WKContextSetHistoryClient() so I tend to agree with you.
> 
> However, I believe this should be done in a separate patch and we will need to CC Andersca.
> 
> For now, what matters is that we get the crashes fixed.

Kenneth, do you mind if we land this patch like it is for now and propose the renaming afterwards? Or do you want to do the renaming beforehand?
Comment 5 Kenneth Rohde Christiansen 2012-12-06 05:04:59 PST
Comment on attachment 177726 [details]
Patch

no
Comment 6 WebKit Review Bot 2012-12-06 05:12:19 PST
Comment on attachment 177726 [details]
Patch

Clearing flags on attachment: 177726

Committed r136833: <http://trac.webkit.org/changeset/136833>
Comment 7 WebKit Review Bot 2012-12-06 05:12:24 PST
All reviewed patches have been landed.  Closing bug.