If webview evas object deleted by application, destructor of RWHVEfl will be
called. And when RWHVEfl deleted, destructor of SelectionControllerEfl also
will be called because RWHVEfl has a scoped_ptr<SelectionControllerEfl>.
SelectionController try to clear all selection by call |ClearSelectionViaEWebView|
in the destructor. In this case, we should check RWHV and WebContents because
these can be deleted already.
Original beta/m47 patch: http://165.213.202.130/gerrit/#/c/105349
Bug: http://107.108.218.239/bugzilla/show_bug.cgi?id=15677
Reviewed by: a1.gomes, sns.park
Change-Id: I4f0cb35b2d68a62408be81c4300e93741f3eae6c
Signed-off-by: SangHyup Lee <sh53.lee@samsung.com>
}
bool SelectionControllerEfl::ClearSelectionViaEWebView() {
- if (GetSelectionStatus()) {
- RenderWidgetHostImpl* rwhi = static_cast<RenderWidgetHostImpl*>(
- web_contents_.GetRenderViewHost()->GetWidget());
- rwhi->ExecuteEditCommand("Unselect", "");
- return true;
+ if (!GetSelectionStatus() || !web_contents_.GetRenderViewHost() ||
+ web_contents_.IsBeingDestroyed()) {
+ return false;
}
- return false;
+ RenderWidgetHostImpl* rwhi = static_cast<RenderWidgetHostImpl*>(
+ web_contents_.GetRenderViewHost()->GetWidget());
+ rwhi->ExecuteEditCommand("Unselect", "");
+ return true;
}
void SelectionControllerEfl::SetSelectionMode(enum SelectionMode mode) {