summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ppapi/proxy/udp_socket_resource_base.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/ppapi/proxy/udp_socket_resource_base.cc b/ppapi/proxy/udp_socket_resource_base.cc
index b5c977c..97864d5 100644
--- a/ppapi/proxy/udp_socket_resource_base.cc
+++ b/ppapi/proxy/udp_socket_resource_base.cc
@@ -320,6 +320,11 @@ void UDPSocketResourceBase::OnPluginMsgPushRecvResult(
void UDPSocketResourceBase::OnPluginMsgSendToReply(
const ResourceMessageReplyParams& params,
int32_t bytes_written) {
+ // This can be empty if the socket was closed, but there are still tasks
+ // to be posted for this resource.
+ if (sendto_callbacks_.empty())
+ return;
+
scoped_refptr<TrackedCallback> callback = sendto_callbacks_.front();
sendto_callbacks_.pop();
if (!TrackedCallback::IsPending(callback))