Index: ppapi/proxy/udp_socket_resource_base.cc |
diff --git a/ppapi/proxy/udp_socket_resource_base.cc b/ppapi/proxy/udp_socket_resource_base.cc |
index b5c977c3a094a2df67f2cc44892a5a33e10150c2..97864d535b2678ccdb191cca0483b6350b69229f 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)) |