From 1581c749871f634d01dcb6e54adcdaf827180819 Mon Sep 17 00:00:00 2001 From: "dp%netscape.com" Date: Thu, 18 Feb 1999 22:37:35 +0000 Subject: [PATCH] Hacked to remove ./ when we PR_LoadLibrary() dlls of the type ./library.so This improves memory a bit. --- xpcom/components/xcDll.cpp | 15 +++++++++++++-- xpcom/src/xcDll.cpp | 15 +++++++++++++-- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/xpcom/components/xcDll.cpp b/xpcom/components/xcDll.cpp index 236868a18ff3..724d13331241 100644 --- a/xpcom/components/xcDll.cpp +++ b/xpcom/components/xcDll.cpp @@ -138,8 +138,19 @@ PRBool nsDll::Load(void) } #else - m_instance = PR_LoadLibrary(m_fullpath); -#endif +#ifdef XP_UNIX + // On linux we seem to load multiple copies of the same dll but with different path + // like libraptorhtml.so and ./libraptorhtml.so + // Until this get fixed right, for now for ./libraptorhtml.so remove the "./" + if (m_fullpath[0] == '.' && m_fullpath[1] == '/') + m_instance = PR_LoadLibrary( &(m_fullpath[2]) ); + else +#endif /* XP_UNIX */ + { + // This is the only right way of doing this... + m_instance = PR_LoadLibrary(m_fullpath); + } +#endif /* XP_MAC */ return ((m_instance == NULL) ? PR_FALSE : PR_TRUE); } diff --git a/xpcom/src/xcDll.cpp b/xpcom/src/xcDll.cpp index 236868a18ff3..724d13331241 100644 --- a/xpcom/src/xcDll.cpp +++ b/xpcom/src/xcDll.cpp @@ -138,8 +138,19 @@ PRBool nsDll::Load(void) } #else - m_instance = PR_LoadLibrary(m_fullpath); -#endif +#ifdef XP_UNIX + // On linux we seem to load multiple copies of the same dll but with different path + // like libraptorhtml.so and ./libraptorhtml.so + // Until this get fixed right, for now for ./libraptorhtml.so remove the "./" + if (m_fullpath[0] == '.' && m_fullpath[1] == '/') + m_instance = PR_LoadLibrary( &(m_fullpath[2]) ); + else +#endif /* XP_UNIX */ + { + // This is the only right way of doing this... + m_instance = PR_LoadLibrary(m_fullpath); + } +#endif /* XP_MAC */ return ((m_instance == NULL) ? PR_FALSE : PR_TRUE); }