Delete MessageData when a message is posted to a quitting MessageQueue
Bug: webrtc:9913 Change-Id: Id60f537eb0049995c9f0837e3a03ca3a3dd90577 Reviewed-on: https://webrtc-review.googlesource.com/c/107639 Reviewed-by: Karl Wiberg <kwiberg@webrtc.org> Commit-Queue: Niels Moller <nisse@webrtc.org> Cr-Commit-Position: refs/heads/master@{#25365}
This commit is contained in:
@ -350,8 +350,10 @@ void MessageQueue::Post(const Location& posted_from,
|
||||
uint32_t id,
|
||||
MessageData* pdata,
|
||||
bool time_sensitive) {
|
||||
if (IsQuitting())
|
||||
if (IsQuitting()) {
|
||||
delete pdata;
|
||||
return;
|
||||
}
|
||||
|
||||
// Keep thread safe
|
||||
// Add the message to the end of the queue
|
||||
@ -407,6 +409,7 @@ void MessageQueue::DoDelayPost(const Location& posted_from,
|
||||
uint32_t id,
|
||||
MessageData* pdata) {
|
||||
if (IsQuitting()) {
|
||||
delete pdata;
|
||||
return;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user