]> granicus.if.org Git - python/commitdiff
Fix for 838140: don't call NSUnlinkModule when we fail to find our
authorJack Jansen <jack.jansen@cwi.nl>
Thu, 15 Jul 2004 22:28:48 +0000 (22:28 +0000)
committerJack Jansen <jack.jansen@cwi.nl>
Thu, 15 Jul 2004 22:28:48 +0000 (22:28 +0000)
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.

Python/dynload_next.c

index cf42cb7151b87b84e7dda5f188394839a419f5cc..27df35696c104e2625ec29d4b19c86f99160dbe0 100644 (file)
@@ -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);