diff options
author | Stinson Linden <stinson@lindenlab.com> | 2014-05-20 01:03:50 +0100 |
---|---|---|
committer | Stinson Linden <stinson@lindenlab.com> | 2014-05-20 01:03:50 +0100 |
commit | 5537417ac35ed36322acdba843bd72bf7a7d1992 (patch) | |
tree | b44af20c8ac5c0e93ecf49444a4551a5cb65f76a /indra | |
parent | babd89b77050ab49166f2fbd6d460884070140d9 (diff) |
MAINT-4009: Ensuring that the cookie store is properly cleaned on app exit.
Diffstat (limited to 'indra')
-rwxr-xr-x | indra/llplugin/llplugincookiestore.cpp | 9 | ||||
-rwxr-xr-x | indra/newview/llviewermedia.cpp | 6 |
2 files changed, 9 insertions, 6 deletions
diff --git a/indra/llplugin/llplugincookiestore.cpp b/indra/llplugin/llplugincookiestore.cpp index f64b264222..a5d717389d 100755 --- a/indra/llplugin/llplugincookiestore.cpp +++ b/indra/llplugin/llplugincookiestore.cpp @@ -27,6 +27,7 @@ */ #include "linden_common.h" +#include "llstl.h" #include "indra_constants.h" #include "llplugincookiestore.h" @@ -654,12 +655,8 @@ void LLPluginCookieStore::setOneCookie(const std::string &s, std::string::size_t void LLPluginCookieStore::clearCookies() { - while(!mCookies.empty()) - { - cookie_map_t::iterator iter = mCookies.begin(); - delete iter->second; - mCookies.erase(iter); - } + std::for_each(mCookies.begin(), mCookies.end(), DeletePairedPointer()); + mCookies.clear(); } void LLPluginCookieStore::removeCookie(const std::string &key) diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index afa2bb6728..a2a3caee00 100755 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -1604,6 +1604,12 @@ void LLViewerMedia::cleanupClass() delete sSpareBrowserMediaSource; sSpareBrowserMediaSource = NULL; } + + if (sCookieStore != NULL) + { + delete sCookieStore; + sCookieStore = NULL; + } } ////////////////////////////////////////////////////////////////////////////////////////// |