Fix leaking file descriptor when a new app is launched 29/34529/1 accepted/tizen_3.0_ivi tizen_3.0_ivi accepted/tizen/3.0/ivi/20150129.001853 submit/tizen_3.0_ivi/20150128.183335 tizen_3.0_ivi_release
authorThiago Marcos P. Santos <thiago.santos@intel.com>
Tue, 27 Jan 2015 17:18:09 +0000 (19:18 +0200)
committerMikko Ylinen <mikko.ylinen@intel.com>
Wed, 28 Jan 2015 16:21:56 +0000 (18:21 +0200)
When establishing a communication channel between the 2 process
we create 2 sockets endpoints and one is sent to the process we
are communicating to. We close our end of the endpoint when the
application is gone.

BUG=TC-2361

Change-Id: I8ad09816d8f9388171162768c057090b63dbe929

src/xwalk/application/browser/linux/running_application_object.cc

index fd94590..39e1ed7 100644 (file)
@@ -119,6 +119,9 @@ RunningApplicationObject::~RunningApplicationObject() {
 
 void RunningApplicationObject::TerminateApplication() {
   application_->Terminate();
+
+  if (ep_bp_channel_.socket.fd != -1)
+    close(ep_bp_channel_.socket.fd);
 }
 
 void RunningApplicationObject::OnExported(const std::string& interface_name,