This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author martind
Recipients StevenY, loewis, martind, pitrou, skrah
Date 2011-10-28.09:08:27
SpamBayes Score 2.1711331e-07
Marked as misclassified No
Message-id <CAK55gbBfH40bJg-Lubknm7nMXmFpO0uB5EdXXi1EdZy_CPqcEw@mail.gmail.com>
In-reply-to <1319755163.11.0.101213996797.issue10363@psf.upfronthosting.co.za>
Content
Hello Antoine

Unloading would not be necessary if the DLL is just the python interpreter,
but if you build a DLL with python embedded that does quite a bit more than
some python interpreting (in my case complex C/C++ numerical calculations)
unloading the DLL is a convenient way to free up unused resources. There are
C++ classes that extend python in my code (via swig), and that's where the
size of the DLL get's increased.

If the handle leaks are restricted to the windows implementation of cpython,
could it not be justified to allow C++ in a patch, I can't think of a C only
compiler for windows?

Thanks

Martin

On Thu, Oct 27, 2011 at 11:39 PM, Antoine Pitrou <report@bugs.python.org>wrote:

>
> Antoine Pitrou <pitrou@free.fr> added the comment:
>
> Here is a patch that fixes some of these handle leaks in Python 3.2.
> However, as a general guideline, you shouldn't unload the Python DLL if you
> fish to use it later again. Just keep it in memory (the DLL isn't very big,
> is it?). Yes, C++ would allow to solve this, but the interpreter is
> currently written in C and there's no plan, even in the middle term, to
> change this.
>
> ----------
> keywords: +patch
> nosy: +loewis
> Added file: http://bugs.python.org/file23539/freelocks.patch
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <http://bugs.python.org/issue10363>
> _______________________________________
>
History
Date User Action Args
2011-10-28 09:08:28martindsetrecipients: + martind, loewis, pitrou, skrah, StevenY
2011-10-28 09:08:28martindlinkissue10363 messages
2011-10-28 09:08:27martindcreate