From e7a5b8aaa5817974ac8a090530f79af42ea60544 Mon Sep 17 00:00:00 2001 From: dgp Date: Sun, 11 Mar 2018 21:14:41 +0000 Subject: Prevent leaks of the Object structs of oo::object and oo::class. --- generic/tclOO.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/generic/tclOO.c b/generic/tclOO.c index 556ad80..587e46d 100644 --- a/generic/tclOO.c +++ b/generic/tclOO.c @@ -552,6 +552,15 @@ KillFoundation( { Foundation *fPtr = GetFoundation(interp); + /* + * Crude mechanism to avoid leaking the Object struct of the + * foundation components oo::object and oo::class + * + * Should probably be replaced with something more elegantly designed. + */ + while (TclOODecrRefCount(fPtr->objectCls->thisPtr) == 0) {}; + while (TclOODecrRefCount(fPtr->classCls->thisPtr) == 0) {}; + TclDecrRefCount(fPtr->unknownMethodNameObj); TclDecrRefCount(fPtr->constructorName); TclDecrRefCount(fPtr->destructorName); -- cgit v0.12