Closes the injector and all sub-injectors. This is also called on
        destruction.

        close() will be called on all managed objects.

def close(self):
        """
        Closes the injector and all sub-injectors. This is also called on
        destruction.

        close() will be called on all managed objects.
        """
        if self.___closed:
            return

        for ref in self.___subs:
            sub = ref()
            if sub is not None:
                sub.close()

        # Destroy in reverse order as first elements created have more components depending on them
        for call in self.___close_list[::-1]:
            if inspect.iscoroutinefunction(call):
                self.loop.run_until_complete(call())
            else:
                call()

        self.___closed = True