1 message in org.python.python-bugs-list[ python-Bugs-909308 ] Embedded Pytho...
FromSent OnAttachments
SourceForge.netMar 3, 2004 3:24 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:[ python-Bugs-909308 ] Embedded Python Interpreter in MFC apps leaksActions...
From:SourceForge.net (nore@sourceforge.net)
Date:Mar 3, 2004 3:24:28 pm
List:org.python.python-bugs-list

Bugs item #909308, was opened at 2004-03-03 21:24 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=909308&group_id=5470

Category: Python Interpreter Core Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: David (yakumoklesk) Assigned to: Nobody/Anonymous (nobody) Summary: Embedded Python Interpreter in MFC apps leaks

Initial Comment: I am embedding the python interpreter in my MFC multidocument application. In the mainframe class, at creation time, I do Py_Initialize(). When the program comes to an end, in the mainframe destructor, I do Py_Finalize(). No Pyobject is created, no PyRun_SimpleString is called, nothing but the Py_Initialize() and the Py_Finalize() only. But those simple calls make the program to report leaks, that when are breakpointed with _CrtSetBreakAlloc (using <crtdbg.h> lib) the code "leaked" stops inside python code.

I made a new project from scratch (multidocument also), without adding no line except Py_Initialize and Py_Finalize, an the leak already exists. I did a Dialog application and used the same calls, and the leak already exists. But when I make a non MFC application, the leak do not exists.

Is this bug a real python bug, or its due an MFC bad implementation of memory allocation? Please, I need to know if there is a way to avoid this leaks, because I want to control what leaks are really mine (c++), what leaks are caused by c++ to python wrapped code, and what leaks are just python, to have a better control of the processes of my application.

I am using Python 2.3.3 and VC++ 6.0 with service pack 5 on a Windows XP Professional with an Athlon XP.

David.

If any information is needed about the leaks and the lines that report to be leaked, just tell me and I&#039;ll made an inform.

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