xbmc/xbmc — pull request #2420 by Montellese (2013-03-11 15:48:30+00:00)
Title: fix possible access violation in CRssManager::Clear() during shutdown

This problem has been reported by @wsoltys and ace20022 but I'm not able to reproduce it. The problem is an access violation exception on win32 in CRssManager::Clear() when closing XBMC. The issue seems to be multiple threads trying to clear the map so I added some locking (which should be there anyway).

Furthermore I've removed the calls to Clear() in the destructors of CSettings and CRssManager as all the cleared member variables would be cleared anyway. The reason for removing it is a possible problem with the order of destruction of static variables. It's possible that CRssManager is destroyed before CSettings is destroyed but ~CSettings() calls CSettings::Clear() which calls CRssManager::Get().Clear() but the static instance returned by CRssManager::Get() has already been destroyed.