code: func (memif *Memif) Close() error {
  	log.WithField("ifName", memif.IfName).Debug("Closing the memif interface")
  
  	// Delete memif from C-libmemif.
  	err := getMemifError(int(C.memif_delete(&memif.cHandle)))
  
  	if err != nil {
  		// Close memif-global interrupt channel.
  		close(memif.intCh)
  		// Close file descriptor stopQPollFd.
  		C.close(C.int(memif.stopQPollFd))
  	}
  
  	context.lock.Lock()
  	defer context.lock.Unlock()
  	// Unregister the interface from the context.
  	delete(context.memifs, memif.ifIndex)
  	log.WithField("ifName", memif.IfName).Debug("memif interface was closed")
  
  	return err
  }
docs: // Close removes the memif interface. If the memif is in the connected state,
  // the connection is first properly closed.
  // Do not access memif after it is closed, let garbage collector to remove it.