summaryrefslogtreecommitdiffstats
path: root/generic/tclOOScript.h
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tclOOScript.h')
-rw-r--r--generic/tclOOScript.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/generic/tclOOScript.h b/generic/tclOOScript.h
index 73c3383..22f5e56 100644
--- a/generic/tclOOScript.h
+++ b/generic/tclOOScript.h
@@ -143,8 +143,9 @@ static const char *tclOOSetupScript =
" variable object\n"
" unexport create createWithNamespace\n"
" method new args {\n"
-" if {![info exists object]} {\n"
+" if {![info exists object] || ![info object isa object $object]} {\n"
" set object [next {*}$args]\n"
+" ::oo::objdefine $object unexport destroy\n"
" }\n"
" return $object\n"
" }\n"