diff options
author | Kai Sommerfeld <kai.sommerfeld@gmx.com> | 2019-05-20 20:07:40 +0200 |
---|---|---|
committer | Kai Sommerfeld <kai.sommerfeld@gmx.com> | 2019-05-26 10:52:15 +0200 |
commit | 5de9680955c2f6b19849c761e7793d0edc2bb990 (patch) | |
tree | f03813b92a5ee19777d136b4815820ec3147a248 | |
parent | dcf4f30da48309821427d5cbb24f8331ee0cdf13 (diff) |
[interfaces] Fix crash on Kodi exit caused by double freed AsyncCallbackMessage.
-rw-r--r-- | xbmc/interfaces/legacy/CallbackHandler.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/xbmc/interfaces/legacy/CallbackHandler.cpp b/xbmc/interfaces/legacy/CallbackHandler.cpp index 393566e953..ac75cbae09 100644 --- a/xbmc/interfaces/legacy/CallbackHandler.cpp +++ b/xbmc/interfaces/legacy/CallbackHandler.cpp @@ -49,16 +49,13 @@ namespace XBMCAddon CallbackQueue::iterator iter = g_callQueue.begin(); while (iter != g_callQueue.end()) { - AddonClass::Ref<AsyncCallbackMessage> cur(*iter); + if ((*iter)->handler.get() == this) // then this message is because of me { - if (cur->handler.get() == this) // then this message is because of me - { - g_callQueue.erase(iter); - iter = g_callQueue.begin(); - } - else - ++iter; + g_callQueue.erase(iter); + iter = g_callQueue.begin(); } + else + ++iter; } } |