Destroy when done.

geesefs-0-30-9
Aaron Jacobs 2015-06-09 11:11:52 +10:00
parent 9cc2a6f450
commit 0f62458e21
2 changed files with 8 additions and 2 deletions

View File

@ -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()

View File

@ -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)
}