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 >> cpp-sig
cpp-sig
[C++-sig] Re: Memory leak when using return_internal_reference !?
by David Abrahams other posts by this author
Jun 4 2003 8:48PM messages near this date
[C++-sig] Re: Memory leak when using return_internal_reference !? | Re: [C++-sig] Re: Memory leak when using return_internal_reference !?
gideon may <gideon@[...].org>  writes:

>  Hi Dave,
> 
>  I'm experiencing a memory leak when using the
>  return_internal_reference policy.
> 
>  It's probably best explained using the the test_pointer_adoption_ext
>  module and a
>  little test program :
> 
>  ----------- leak.py -----------------
> 
>  from test_pointer_adoption_ext import *
> 
>  a = create("leak")
>  while 1:
>      innards = a.get_inner()
>      innards = None
>      print ".",
>  --------------------------------------
> 
>  When running this program, there is a serious memory leak. When I take out
>  the line 'innards = a.get_inner()' everything is OK.
>  I tried to hunt it down and it seems that life_support system created
>  in life_support.cpp is never deleted, i.e. life_support_dealloc is
>  never called.
> 
>  Do you have any idea what could be the problem ?

Perhaps... a bug in Boost.Python??!

Fixed in CVS, thanks for reporting it.  Extra bonus points if you can
supply a patch to the test that will detect this bug!

>  I'm using return_internal_reference quite extensively and couldn't live
>  without it :-)

Doubtless that's true.  I can't believe I never saw this one before.
That's what you get for not having tests :(
-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com


_______________________________________________
C++-sig mailing list
C++-sig@[...].org
http://mail.python.org/mailman/listinfo/c++-sig
Thread:
gideon may
David Abrahams
David Abrahams
gideon may

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved