incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arie...@apache.org
Subject svn commit: r1388592 - /incubator/ooo/trunk/main/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx
Date Fri, 21 Sep 2012 18:08:44 GMT
Author: arielch
Date: Fri Sep 21 18:08:44 2012
New Revision: 1388592

URL: http://svn.apache.org/viewvc?rev=1388592&view=rev
Log:
#i119525# - List only JREs whose jvm library can be loaded

Modified:
    incubator/ooo/trunk/main/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx

Modified: incubator/ooo/trunk/main/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx?rev=1388592&r1=1388591&r2=1388592&view=diff
==============================================================================
--- incubator/ooo/trunk/main/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx (original)
+++ incubator/ooo/trunk/main/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx Fri Sep 21 18:08:44
2012
@@ -25,6 +25,9 @@
 #include "precompiled_jvmfwk.hxx"
 
 #include "osl/file.hxx"
+#include "osl/diagnose.h"
+#include "osl/module.hxx"
+#include "osl/thread.hxx"
 
 #include "vendorbase.hxx"
 #include "util.hxx"
@@ -180,6 +183,25 @@ bool VendorBase::initialize(vector<pair<
     if (!bRt)
         return false;
 
+#if defined(WNT)
+    oslModule moduleRt = 0;
+    rtl::OUString sRuntimeLib;
+    if( File::getSystemPathFromFileURL( m_sRuntimeLibrary, sRuntimeLib ) == File::E_None
)
+    {
+        if ( ( moduleRt = osl_loadModule( sRuntimeLib.pData, SAL_LOADMODULE_DEFAULT ) ) ==
0 )
+        {
+            OSL_TRACE( "jfw_plugin::VendorBase::initialize - cannot load library %s",
+			           rtl::OUStringToOString( sRuntimeLib, osl_getThreadTextEncoding() ).getStr()
);
+            return false;
+        }
+        else
+        {
+            // do not leave the module loaded!
+            osl_unloadModule( moduleRt );
+        }
+    }
+#endif
+
     // init m_sLD_LIBRARY_PATH
     OSL_ASSERT(m_sHome.getLength());
     size = 0;



Mime
View raw message