From ac966d7dd2aa7e14a24ba2fb2a0106b761473db0 Mon Sep 17 00:00:00 2001 From: "Gustavo J. A. M. Carneiro" Date: Tue, 19 Jul 2011 19:49:04 +0100 Subject: [PATCH] Cannot allow subclassing if a destructor is private --- pybindgen/cppclass.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pybindgen/cppclass.py b/pybindgen/cppclass.py index 476ebd6..a88691f 100644 --- a/pybindgen/cppclass.py +++ b/pybindgen/cppclass.py @@ -633,7 +633,11 @@ class CppClass(object): else: if any([p.allow_subclassing for p in self.bases]) and not allow_subclassing: raise ValueError("Cannot disable subclassing if a parent class allows it") - self.allow_subclassing = allow_subclassing + else: + self.allow_subclassing = allow_subclassing + + if self.destructor_visibility in ['public', 'protected']: + self.allow_subclassing = False self.typeid_map_name = None