🎉 Celebrating 25 Years of GameDev.net! 🎉
Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!
Memory leak about boost.python
i write these codes:
m_MainModule.reset( new extract<object>(PyImport_AddModule("__main__"))() );
m_MainModule is a boost share_ptr object
so i found it casuses memory leak.
is any method to solute the problem?
thankss
From the tutorial: handle<> main_module(borrowed( PyImport_AddModule("__main__") ));
[edited by - Fruny on April 27, 2004 9:54:30 AM]
[edited by - Fruny on April 27, 2004 9:54:30 AM]
i have search many website,but i dont find any boost.python script engine .
do u know any open source script engine?
do u know any open source script engine?
i write these codes just now:
class xx
{
protected:
handle<> m_Module;
}
then it causes leak already.
class xx
{
protected:
handle<> m_Module;
}
then it causes leak already.
my codes:
void Initialize( void )
{
if (!Py_IsInitialized())
{
Py_Initialize();
}
handle<> main_module(borrowed( PyImport_AddModule("__main__") ));
}
only these codes, and i dont excute this function, it also causes leak!
i cant understand. faint....
void Initialize( void )
{
if (!Py_IsInitialized())
{
Py_Initialize();
}
handle<> main_module(borrowed( PyImport_AddModule("__main__") ));
}
only these codes, and i dont excute this function, it also causes leak!
i cant understand. faint....
As much as i''d like to bash Python i have to say, that Boundschecker sometimes doesn''t recognize globals/non-pointer-members as being automatically removed/deleted. Boundschecker is a fantastic tools for finding leaks (and more) but sometimes it doesn''t show things right.
Try to add that handler as a pointer, new it on begin and delete in on the end. If the memory leak is still there then it''s real.
If the leak points to inside the boost.python.something then you could look into the boost.python FAQ or email the boost.python guys.
Try to add that handler as a pointer, new it on begin and delete in on the end. If the memory leak is still there then it''s real.
If the leak points to inside the boost.python.something then you could look into the boost.python FAQ or email the boost.python guys.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement