     }
 
     deinit {
+        assert(!self.open, "Selector still open on deinit")
         events.deinitialize()
         events.deallocate(capacity: eventsCapacity)
     }

    }

    private func register_kqueue(selectable: Selectable, interested: InterestedEvent, oldInterested: InterestedEvent?) throws {
        // Allocated on the stack
        var events = (kevent(), kevent())


    }

    private func keventChangeSetOnly(event: UnsafePointer<kevent>?, numEvents: Int32) throws {
        guard self.open else {
            throw IOError(errno: EBADF, reason: "can't kevent selector as it's not open anymore.")
        }

        let _ = try wrapSyscall({ $0 >= 0 }, function: "kevent") {
            let res = kevent(self.fd, event, numEvents, nil, 0, nil)
            if res < 0  && errno == EINTR {
