From d6c53efae5d34d8edeba9269312d45c189d2ffdd Mon Sep 17 00:00:00 2001
From: Evan Broder <broder@mit.edu>
Date: Sun, 21 Dec 2008 04:33:25 -0600
Subject: [PATCH] Cleanup the mess we make.

Signed-off-by: Evan Broder <broder@mit.edu>
---
 afs/_pts.pyx |    3 +++
 afs/afs.pxd  |    1 +
 2 files changed, 4 insertions(+)

diff --git a/afs/_pts.pyx b/afs/_pts.pyx
index 6678418..43a0f03 100644
--- a/afs/_pts.pyx
+++ b/afs/_pts.pyx
@@ -11,3 +11,6 @@ cdef class PTS:
         code = a.rx_Init(0)
         if code != 0:
             raise Exception(str(code))
+    
+    def __dealloc__(self):
+        a.rx_Finalize()
diff --git a/afs/afs.pxd b/afs/afs.pxd
index 5fb03e7..e0684d9 100644
--- a/afs/afs.pxd
+++ b/afs/afs.pxd
@@ -10,3 +10,4 @@ cdef extern from "ubik.h":
 
 cdef extern from "rx/rx.h":
     int rx_Init(int port)
+    void rx_Finalize()
-- 
1.7.9.5