diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2017-04-11 18:04:54 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2017-04-11 18:04:54 +0200 |
commit | f0454e72c1d1b11c3bcbacb23048a62fdecd037c (patch) | |
tree | 14159abbfbc60777e4c6fbf7d711aed22bac33fd /stoc | |
parent | 6bb4c48812224237c29acf31264cc05e2938f242 (diff) |
Use std::unique_ptr<JavaInfo> for lifecycle management in jvmfwk/framework.hxx
Change-Id: Ie604c75e92c407ff3118aaa58155648d956c91fb
Diffstat (limited to 'stoc')
-rw-r--r-- | stoc/source/javavm/javavm.cxx | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/stoc/source/javavm/javavm.cxx b/stoc/source/javavm/javavm.cxx index 7c07453e8b82..41d786f91a82 100644 --- a/stoc/source/javavm/javavm.cxx +++ b/stoc/source/javavm/javavm.cxx @@ -700,7 +700,7 @@ JavaVirtualMachine::getJavaVM(css::uno::Sequence< sal_Int8 > const & rProcessId) if (aId != aProcessId) return css::uno::Any(); - jfw::JavaInfoGuard info; + std::unique_ptr<JavaInfo> info; while (!m_xVirtualMachine.is()) // retry until successful { stoc_javavm::JVM aJvm; @@ -741,7 +741,7 @@ JavaVirtualMachine::getJavaVM(css::uno::Sequence< sal_Int8 > const & rProcessId) if (getenv("STOC_FORCE_NO_JRE")) errcode = JFW_E_NO_SELECT; else - errcode = jfw_startVM(info.info, arOptions, index, & m_pJavaVm, + errcode = jfw_startVM(info.get(), arOptions, index, & m_pJavaVm, & pMainThreadEnv); bool bStarted = false; @@ -751,8 +751,8 @@ JavaVirtualMachine::getJavaVM(css::uno::Sequence< sal_Int8 > const & rProcessId) case JFW_E_NO_SELECT: { // No Java configured. We silently run the Java configuration - info.clear(); - javaFrameworkError errFind = jfw_findAndSelectJRE(&info.info); + info.reset(); + javaFrameworkError errFind = jfw_findAndSelectJRE(&info); if (getenv("STOC_FORCE_NO_JRE")) errFind = JFW_E_NO_JAVA_FOUND; if (errFind == JFW_E_NONE) @@ -812,18 +812,18 @@ JavaVirtualMachine::getJavaVM(css::uno::Sequence< sal_Int8 > const & rProcessId) //we search another one. As long as there is a javaldx, we should //never come into this situation. javaldx checks always if the JRE //still exist. - jfw::JavaInfoGuard aJavaInfo; - if (JFW_E_NONE == jfw_getSelectedJRE(&aJavaInfo.info)) + std::unique_ptr<JavaInfo> aJavaInfo; + if (JFW_E_NONE == jfw_getSelectedJRE(&aJavaInfo)) { sal_Bool bExist = false; - if (JFW_E_NONE == jfw_existJRE(aJavaInfo.info, &bExist)) + if (JFW_E_NONE == jfw_existJRE(aJavaInfo.get(), &bExist)) { if (!bExist - && ! (aJavaInfo.info->nRequirements & JFW_REQUIRE_NEEDRESTART)) + && ! (aJavaInfo->nRequirements & JFW_REQUIRE_NEEDRESTART)) { - info.clear(); + info.reset(); javaFrameworkError errFind = jfw_findAndSelectJRE( - &info.info); + &info); if (errFind == JFW_E_NONE) { continue; |