veyron/lib/stats: Add Delete function
The new Delete function is used to delete a stats object from the tree,
along with any children below it.
Use this function to clean up the ipc server stats when the server is
stopped.
Change-Id: I84eec2a015ad7affead9d73dbbcbc8536ee98ccc
diff --git a/runtimes/google/ipc/server.go b/runtimes/google/ipc/server.go
index 7665b83..a8ff3b3 100644
--- a/runtimes/google/ipc/server.go
+++ b/runtimes/google/ipc/server.go
@@ -499,6 +499,9 @@
close(s.stoppedChan)
s.Unlock()
+ // Delete the stats object.
+ s.stats.stop()
+
// Note, It's safe to Stop/WaitForStop on the publisher outside of the
// server lock, since publisher is safe for concurrent access.