summaryrefslogtreecommitdiffstats
path: root/Python/dynload_next.c
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>2004-07-15 22:28:48 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>2004-07-15 22:28:48 (GMT)
commite4979782017e2a436c7f5634cb7347a420157ec5 (patch)
tree5d55fac802df0acfc6b9555a6509f838dfb764b8 /Python/dynload_next.c
parentad1654e03aca95f8d5cad75ad377c3b67cb73f91 (diff)
downloadcpython-e4979782017e2a436c7f5634cb7347a420157ec5.zip
cpython-e4979782017e2a436c7f5634cb7347a420157ec5.tar.gz
cpython-e4979782017e2a436c7f5634cb7347a420157ec5.tar.bz2
Fix for 838140: don't call NSUnlinkModule when we fail to find our
expected entrypoint. The unlinking will crash the application if the module contained ObjC code. The price of this is small: a little wasted memory, and only in a case than isn't expected to occur often.
Diffstat (limited to 'Python/dynload_next.c')
-rw-r--r--Python/dynload_next.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Python/dynload_next.c b/Python/dynload_next.c
index cf42cb7..27df356 100644
--- a/Python/dynload_next.c
+++ b/Python/dynload_next.c
@@ -92,7 +92,7 @@ dl_funcptr _PyImport_GetDynLoadFunc(const char *fqname, const char *shortname,
#ifdef USE_DYLD_GLOBAL_NAMESPACE
if (!NSIsSymbolNameDefined(funcname)) {
/* UnlinkModule() isn't implemented in current versions, but calling it does no harm */
- NSUnLinkModule(newModule, FALSE);
+ /* NSUnLinkModule(newModule, FALSE); removed: causes problems for ObjC code */
PyErr_Format(PyExc_ImportError,
"Loaded module does not contain symbol %.200s",
funcname);
@@ -102,7 +102,7 @@ dl_funcptr _PyImport_GetDynLoadFunc(const char *fqname, const char *shortname,
#else
theSym = NSLookupSymbolInModule(newModule, funcname);
if ( theSym == NULL ) {
- NSUnLinkModule(newModule, FALSE);
+ /* NSUnLinkModule(newModule, FALSE); removed: causes problems for ObjC code */
PyErr_Format(PyExc_ImportError,
"Loaded module does not contain symbol %.200s",
funcname);