Skip to content

Commit

Permalink
Deallocate vtable when going out of scope
Browse files Browse the repository at this point in the history
  • Loading branch information
markflorisson committed Mar 11, 2013
1 parent 3b9dff9 commit 4edb5f4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions extensibletype/methodtable.pyx
Expand Up @@ -99,6 +99,10 @@ cdef class PerfectHashMethodTable(object):
return (<uintptr_t> self.table.entries[idx].ptr,
self.table.entries[idx].flags)

def __dealloc__(self):
stdlib.free(self.table)
self.table = NULL

property table_ptr:
def __get__(self):
return <uintptr_t> self.table
Expand Down

0 comments on commit 4edb5f4

Please sign in to comment.