Prevent double-destroy of queue in __dealloc__

If the user calls unbind, the queue is destroyed.

When the GC then runs again the queue is destroyed incorrectly in __dealloc__
This commit is contained in:
remleduff 2015-07-16 17:35:23 -04:00
parent 53a55fd588
commit 7db2fd300f
1 changed files with 1 additions and 0 deletions

View File

@ -170,6 +170,7 @@ cdef class NetfilterQueue:
"""Destroy the queue."""
if self.qh != NULL:
nfq_destroy_queue(self.qh)
self.qh = NULL
# See warning about nfq_unbind_pf in __dealloc__ above.
def run(self):