File descriptors, whether they point to files, sockets, or inotify instances, must belong to at least one process – they are automatically closed when the last process exits.
Similarly, when all file descriptors referring to an inotify instance have been closed, the underlying object and its resources are freed for reuse by the kernel; all associated watches are automatically freed. (inotify(7))