diff options
-rw-r--r-- | libs/vr/libbufferhub/buffer_hub-test.cpp | 7 | ||||
-rw-r--r-- | services/vr/bufferhubd/producer_channel.cpp | 1 |
2 files changed, 6 insertions, 2 deletions
diff --git a/libs/vr/libbufferhub/buffer_hub-test.cpp b/libs/vr/libbufferhub/buffer_hub-test.cpp index 3ce5c9f8d6..660a2003ea 100644 --- a/libs/vr/libbufferhub/buffer_hub-test.cpp +++ b/libs/vr/libbufferhub/buffer_hub-test.cpp @@ -769,9 +769,14 @@ TEST_F(LibBufferHubTest, TestDetachBufferFromProducer) { auto s3 = p->CreateConsumer(); EXPECT_FALSE(s3); + // Note that here the expected error code is EOPNOTSUPP as the socket towards + // ProducerChannel has been teared down. EXPECT_EQ(s3.error(), EOPNOTSUPP); s3 = c->CreateConsumer(); EXPECT_FALSE(s3); - EXPECT_EQ(s3.error(), EOPNOTSUPP); + // Note that here the expected error code is EPIPE returned from + // ConsumerChannel::HandleMessage as the socket is still open but the producer + // is gone. + EXPECT_EQ(s3.error(), EPIPE); } diff --git a/services/vr/bufferhubd/producer_channel.cpp b/services/vr/bufferhubd/producer_channel.cpp index e141b91286..c38c12b7b1 100644 --- a/services/vr/bufferhubd/producer_channel.cpp +++ b/services/vr/bufferhubd/producer_channel.cpp @@ -134,7 +134,6 @@ ProducerChannel::~ProducerChannel() { channel_id(), buffer_id(), buffer_state_->load()); for (auto consumer : consumer_channels_) { consumer->OnProducerClosed(); - service()->SetChannel(consumer->channel_id(), nullptr); } Hangup(); } |