/**
  * @param string $name
  *
  * @return object
  *
  * @throws Xinc\Core\Registry\Exception
  */
 public function unregister($name)
 {
     $widget = parent::unregister($name);
     $paths = $widget->getPaths();
     if (!is_array($paths)) {
         $this->log->warn(get_class($widget) . '::getPaths has invalid return value.');
         $paths = array();
     }
     foreach ($paths as $path) {
         unset($this->paths[$path]);
     }
     return $widget;
 }