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] Memory leak when using return_internal_reference !?
by gideon may other posts by this author
Jun 4 2003 6:07PM messages near this date
[C++-sig] Building Boost.Python on MingW(win98) | [C++-sig] Re: Memory leak when using return_internal_reference !?
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 ?

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

ciao,

gideon

_______________________________________________
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