ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> incrtcl-develop
incrtcl-develop
[Incrtcl-develop] [ incrtcl-Patches-1521995 ] Patch for destructor chaining bug (#1440882)
by SourceForge.net other posts by this author
Jul 13 2006 11:45AM messages near this date
[Incrtcl-develop] [ incrtcl-Patches-1527656 ] Remove [update]s in several Iwidgets' widgets | [Incrtcl-develop] [ incrtcl-Bugs-1503328 ] Memory Leakage: [uplevel [info heritage]]
Patches item #1521995, was opened at 2006-07-13 11:45
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=313244&aid=1521995&group_id=13244

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: Patch for destructor chaining bug (#1440882)

Initial Comment:
Base class destructors are not called properly executed 
if the derived class is in a different namespace but 
has the same name as the base class.

This bug has already been reported as #1440882 and 
#1064491.

I have just run into the same bug, which manifested 
itself as a memory leak because the base class 
destructor did not get called, and thus did not delete 
some member objects.

The bug reports quoted above include an example, and 
indicate how to fix the bug in the [incr Tcl] source.

I decided to send in a patch file in the hope that this 
has a better chance of getting applied.

Here's a test case:

package require Itcl

namespace eval X {
  variable Xi 0

  itcl::class A {
    constructor {} {
      incr ::X::Xi
      puts "X::A::constructor"
    }

    destructor {
        incr ::X::Xi -1
        puts "X::A::destructor"
    }
  }
}

namespace eval Y {
  itcl::class A {
    inherit ::X::A

    constructor {} {
      puts "Y::A::constructor"
    }

    destructor {
      puts "Y::A::destructor"
    }
  }
}

set b [Y::A \#auto]
itcl::delete object $b

if {$::X::Xi eq 0} {
    puts "Test passed."
} else {
    puts "Test failed."
}


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=313244&aid=1521995&group_id=13244


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Incrtcl-develop mailing list
Incrtcl-develop@[...].net
https://lists.sourceforge.net/lists/listinfo/incrtcl-develop

Privacy Policy | Email Opt-out | Feedback | Syndication
© 2004 ActiveState, a division of Sophos All rights reserved