Destroy when done.
parent
9cc2a6f450
commit
0f62458e21
|
@ -90,7 +90,12 @@ type fileSystemServer struct {
|
|||
}
|
||||
|
||||
func (s *fileSystemServer) ServeOps(c *fuse.Connection) {
|
||||
defer s.opsInFlight.Wait()
|
||||
// When we are done, we clean up by waiting for all in-flight ops then
|
||||
// destroying the file system.
|
||||
defer func() {
|
||||
s.opsInFlight.Wait()
|
||||
s.fs.Destroy()
|
||||
}()
|
||||
|
||||
for {
|
||||
op, err := c.ReadOp()
|
||||
|
|
|
@ -27,7 +27,8 @@ import (
|
|||
// A type that knows how to serve ops read from a connection.
|
||||
type Server interface {
|
||||
// Read and serve ops from the supplied connection until EOF. Do not return
|
||||
// until all operations have been responded to.
|
||||
// until all operations have been responded to. Must not be called more than
|
||||
// once.
|
||||
ServeOps(*Connection)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue