please review the following code…
class Client(MqC):
def __init__(self, tmpl=None):
self.ConfigSetBgError(self.BgError)
MqC.__init__(self)
def BgError(self):
... do some stuff……
I can add the callback BgError
as class or as object callback…
- class =
self.ConfigSetBgError(Client.BgError)
- object =
self.ConfigSetBgError(self.BgError)
both cases are working because the callback code can handle this
the problem is the refCount of the self object… the case (2) increment the refCount by ONE… so the following code shows the difference code…
cl = Client()
print("refCount=" + str(sys.getrefcount(cl)))
cl = None
.tp_dealloc
is called… becauserefCount=2
.tp_dealloc
is NOT called becauserefCount=3
→ so… question… ho to solve this refCount cleanup issue ?