summaryrefslogtreecommitdiffstats
path: root/ipc
diff options
context:
space:
mode:
authordmichael@chromium.org <dmichael@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-16 18:58:32 +0000
committerdmichael@chromium.org <dmichael@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-16 18:58:32 +0000
commit5fc7ec596d5287922fa676eb7a170e0b2459b9f0 (patch)
treebeff295b2533e492016c8df068e1a9d4a6a245bd /ipc
parent90944ccf12661a290bf4c9eeb864fe5c3f744566 (diff)
downloadchromium_src-5fc7ec596d5287922fa676eb7a170e0b2459b9f0.zip
chromium_src-5fc7ec596d5287922fa676eb7a170e0b2459b9f0.tar.gz
chromium_src-5fc7ec596d5287922fa676eb7a170e0b2459b9f0.tar.bz2
PPAPI/NaCl: Fix leaky NaClIPCAdapter test.
The NaClIPCAdapter was not leaking, but the Channel deletion is posted as a task that the test was not running. This makes all the NaClIPCAdapter test cases do RunAllPending on shutdown to delete stuff. Unfortunately, one of the tests results in calling "Close()" on the channel in one of these tasks, and that fails for IPC::TestSink, because IPC::Channel::Close dereferences channel_impl_ unconditionally, and the channel_impl_ is NULL for TestSink. So this patch also makes Channel::Close() do nothing if channel_impl_ is NULL. BUG=127954 TEST= Review URL: https://chromiumcodereview.appspot.com/10383167 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@137471 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ipc')
-rw-r--r--ipc/ipc_channel_posix.cc3
-rw-r--r--ipc/ipc_channel_win.cc3
2 files changed, 4 insertions, 2 deletions
diff --git a/ipc/ipc_channel_posix.cc b/ipc/ipc_channel_posix.cc
index bb1aa05..9d9b8d1 100644
--- a/ipc/ipc_channel_posix.cc
+++ b/ipc/ipc_channel_posix.cc
@@ -1126,7 +1126,8 @@ bool Channel::Connect() {
}
void Channel::Close() {
- channel_impl_->Close();
+ if (channel_impl_)
+ channel_impl_->Close();
}
void Channel::set_listener(Listener* listener) {
diff --git a/ipc/ipc_channel_win.cc b/ipc/ipc_channel_win.cc
index bbb2eb9..981e4b6 100644
--- a/ipc/ipc_channel_win.cc
+++ b/ipc/ipc_channel_win.cc
@@ -462,7 +462,8 @@ bool Channel::Connect() {
}
void Channel::Close() {
- channel_impl_->Close();
+ if (channel_impl_)
+ channel_impl_->Close();
}
void Channel::set_listener(Listener* listener) {