Permalink
Browse files

Fix visualization freezes if user goes to main menu while playing son…

…g with Milkdrop and stops music. ProjectM fixes crash in same scenario.
  • Loading branch information...
1 parent f835fb5 commit a0a3b5c1d80427867e87b665babfb3be44ea882a @classicspam classicspam committed Aug 11, 2012
Showing with 9 additions and 1 deletion.
  1. +5 −1 xbmc/addons/AddonDll.h
  2. +4 −0 xbmc/visualizations/XBMCProjectM/Main.cpp
View
@@ -240,7 +240,11 @@ void CAddonDll<TheDll, TheStruct, TheProps>::Stop()
{
strcpy(str_id, "###GetSavedSettings");
sprintf (str_value, "%i", i);
- m_pDll->SetSetting((const char*)&str_id, (void*)&str_value);
+ ADDON_STATUS status = m_pDll->SetSetting((const char*)&str_id, (void*)&str_value);
+
+ if (status == ADDON_STATUS_UNKNOWN)
+ break;
+
if (strcmp(str_id,"###End") != 0) UpdateSetting(str_id, str_value);
}
CAddon::SaveSettings();
@@ -381,6 +381,10 @@ extern "C" ADDON_STATUS ADDON_SetSetting(const char* id, const void* value)
if (strcmp(id, "###GetSavedSettings") == 0) // We have some settings to be saved in the settings.xml file
{
+ if (!globalPM)
+ {
+ return ADDON_STATUS_UNKNOWN;
+ }
if (strcmp((char*)value, "0") == 0)
{
strcpy((char*)id, "lastpresetfolder");

0 comments on commit a0a3b5c

Please sign in to comment.