Permalink
Browse files

Only log about stopping or destroying a DLL if it was actually stoppe…

…d or destroyed
  • Loading branch information...
1 parent 87f3fac commit b9d1ac8ec771a4c7546a90638083ad99d9aecfb2 @garbear garbear committed Jul 7, 2012
Showing with 11 additions and 5 deletions.
  1. +11 −5 xbmc/addons/AddonDll.h
View
@@ -234,13 +234,16 @@ void CAddonDll<TheDll, TheStruct, TheProps>::Stop()
}
CAddon::SaveSettings();
}
- if (m_pDll) m_pDll->Stop();
+ if (m_pDll)
+ {
+ m_pDll->Stop();
+ CLog::Log(LOGINFO, "ADDON: Dll Stopped - %s", Name().c_str());
+ }
}
catch (std::exception &e)
{
HandleException(e, "m_pDll->Stop");
}
- CLog::Log(LOGINFO, "ADDON: Dll Stopped - %s", Name().c_str());
}
template<class TheDll, typename TheStruct, typename TheProps>
@@ -261,10 +264,13 @@ void CAddonDll<TheDll, TheStruct, TheProps>::Destroy()
}
free(m_pStruct);
m_pStruct = NULL;
- delete m_pDll;
- m_pDll = NULL;
+ if (m_pDll)
+ {
+ delete m_pDll;
+ m_pDll = NULL;
+ CLog::Log(LOGINFO, "ADDON: Dll Destroyed - %s", Name().c_str());
+ }
m_initialized = false;
- CLog::Log(LOGINFO, "ADDON: Dll Destroyed - %s", Name().c_str());
}
template<class TheDll, typename TheStruct, typename TheProps>

0 comments on commit b9d1ac8

Please sign in to comment.