diff --git a/TODO.txt b/TODO.txt
index a648a06..4a48a28 100644
--- a/TODO.txt
+++ b/TODO.txt
@@ -14,3 +14,7 @@ Other
 - Make the Py_LOCAL_INLINE macro to work with Python 2.6, 2.7 and 3.1
 - Use surrogateescape in Python 3, see PEP-383
 - Expose the ODB (Repository.odb)
+- According to Python documentation, tp_dealloc must call tp_free (instead of
+  PyObject_Del or similar) if the type is subclassable. So, go through the
+  code and switch to tp_free, or make the type not subclassable, on a case by
+  case basis.
diff --git a/pygit2.c b/pygit2.c
index e81c05e..7769ff4 100644
--- a/pygit2.c
+++ b/pygit2.c
@@ -1607,6 +1607,7 @@ static void
 TreeBuilder_dealloc(TreeBuilder* self)
 {
     git_treebuilder_free(self->bld);
+    PyObject_Del(self);
 }
 
 static PyObject *