WIP Add-On system reworks
#16
Can someone help me to introduce exception handling on Windows?

On linux and Mac OS X is the way here possible:
- https://github.com/AlwinEsch/kodi/blob/b...#L279-L303

There becomes asked with "CThread::HasCrashProtection()" and if yes the from e.g. Add-on registered handler does the work for them.

This the way how registration works on every call from Kodi to Add-on:
Code:
try
  {
    CThread::SetCrashProtection(this);
    strConnectionString = m_pStruct->GetConnectionString();
    CThread::SetCrashProtection(nullptr);
  }
  HANDLE_ADDON_EXCEPTION

And a crash becomes handled from this for add-ons:
Code:
void CAddonExceptionHandler::Handle(const ADDON::WrongValueException& e, bool onCrashProtectionStart/* = false*/)
{
  CLog::Log(LOGERROR,"EXCEPTION: %s", e.GetMessage());

  DestroyAddon(dynamic_cast<CAddon*>(CThread::CrashProtection()));

  /*
   * If onCrashProtectionStart is false go to the first 'try' where the
   * exception handler was set.
   */
  if (!onCrashProtectionStart)
    throw UnimplementedException("CAddonExceptionHandler", "Falling back to last tries");
}
Reply

Logout Mark Read Team Forum Stats Members Help
Add-On system reworks0