Mercurial > cpython-lru_cache-weakref
diff Python/dynload_next.c @ 32707:f08529879db1 legacy-trunk
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.
| author | Jack Jansen <jack.jansen@cwi.nl> |
|---|---|
| date | Thu, 15 Jul 2004 22:28:48 +0000 |
| parents | 6b31b26e418d |
| children | fd25030223b0 94f64f11fdd0 |
line wrap: on
line diff
--- a/Python/dynload_next.c Thu Jul 15 22:08:33 2004 +0000 +++ b/Python/dynload_next.c Thu Jul 15 22:28:48 2004 +0000 @@ -92,7 +92,7 @@ #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 @@ #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);
