old_contents: import xbmc
  import urllib2
  import threading
  from pulsar.config import PULSARD_HOST
  
  
  class PulsarMonitor(xbmc.Monitor):
      def __init__(self):
          self._closing = threading.Event()
  
      @property
      def closing(self):
          return self._closing
  
      def onAbortRequested(self):
          self._closing.set()
  
      def onSettingsChanged(self):
          try:
              urllib2.urlopen("%s/reload" % PULSARD_HOST)
          except:
              pass
  
new_contents: import xbmc
  import urllib2
  import threading
  from pulsar.config import PULSARD_HOST
  
  
  class PulsarMonitor(xbmc.Monitor):
      def __init__(self):
          self._closing = threading.Event()
  
      @property
      def closing(self):
          return self._closing
  
      def onAbortRequested(self):
          # Only when closing Kodi
          if xbmc.abortRequested:
              self._closing.set()
              self._closing.clear()
  
      def onSettingsChanged(self):
          try:
              urllib2.urlopen("%s/reload" % PULSARD_HOST)
          except:
              pass
  
subject: Fix issue where Pulsar would enter a restart loop when cancelling a buffering