XBPython: fix crash on exit because of executing onNotification callback on already...
authormontellese <montellese@xbmc.org>
Tue, 10 Sep 2013 21:33:28 +0000 (23:33 +0200)
committermontellese <montellese@xbmc.org>
Wed, 11 Sep 2013 07:06:28 +0000 (09:06 +0200)
xbmc/interfaces/python/XBPython.cpp

index 281a029..a5c96d6 100644 (file)
@@ -563,6 +563,11 @@ void XBPython::Finalize()
 
 void XBPython::Uninitialize()
 {
+  // don't handle any more announcements as most scripts are probably already
+  // stopped and executing a callback on one of their already destroyed classes
+  // would lead to a crash
+  CAnnouncementManager::RemoveAnnouncer(this);
+
   LOCK_AND_COPY(std::vector<PyElem>,tmpvec,m_vecPyList);
   m_vecPyList.clear();
   m_vecPyList.hadSomethingRemoved = true;