Fix memory leaks in browser process 94/34794/3 tizen_3.0.2014.q4_common accepted/tizen/common/20150204.100128 accepted/tizen/mobile/20150205.042646 accepted/tizen/tv/20150206.074813 accepted/tizen/wearable/20150204.014319 submit/tizen_common/20150203.085138 submit/tizen_common/20150204.082837 submit/tizen_ivi/20150203.085144 submit/tizen_ivi/20150206.082313 submit/tizen_mobile/20150204.011944 submit/tizen_tv/20150204.012408 submit/tizen_wearable/20150204.011455
authorJoone Hur <joone.hur@intel.com>
Tue, 3 Feb 2015 00:06:20 +0000 (16:06 -0800)
committerBaptiste DURAND <baptiste.durand@gmail.com>
Tue, 3 Feb 2015 08:50:35 +0000 (09:50 +0100)
This patch allows to destroy a XWalkExtensionData object
in XWalkExtensionService when a render process is killed.

BUG=TC-2407

Change-Id: Iabdbaa0401b3fd1e1666999b6f240a601e3c25d3

src/xwalk/application/browser/application.cc
src/xwalk/extensions/browser/xwalk_extension_process_host.cc

index 0ed2bfa..a5555ba 100644 (file)
@@ -302,6 +302,9 @@ void Application::RenderProcessHostDestroyed(RenderProcessHost* host) {
   DCHECK(render_process_host_ == host);
   if (render_process_host_)
     render_process_host_->RemoveObserver(this);
+  // FIXME: Application::RenderProcessExited is not called so run
+  // OnRenderProcessHostGone here.
+  XWalkRunner::GetInstance()->OnRenderProcessHostGone(host);
   render_process_host_ = NULL;
   web_contents_ = NULL;
 }
index 51ad9ed..4430fea 100644 (file)
@@ -222,6 +222,9 @@ void XWalkExtensionProcessHost::StopProcess() {
     process_.reset();
   if (channel_)
     channel_.reset();
+
+  if (delegate_)
+    delegate_->OnExtensionProcessDied(this, render_process_host_->GetID());
 }
 
 void XWalkExtensionProcessHost::OnGetExtensionProcessChannel(