summaryrefslogtreecommitdiff
path: root/stoc
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2021-03-22 13:45:32 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-03-23 07:39:40 +0100
commit951a9342631129832e647bd8a303a959308bad65 (patch)
tree1d046eea32882b50fc5cfd4cc36eb5307b97051d /stoc
parent76a30ac646faf1c638736c10e834bb7b0ed243ef (diff)
use single-use attribute for JavaVirtualMachine
instead of rtl::Instance, which means it will get cleaned up when UNO shuts down Change-Id: Iecf943584d71aac0ed147ff4b6fce49192ef2787 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112929 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'stoc')
-rw-r--r--stoc/source/javavm/javavm.component3
-rw-r--r--stoc/source/javavm/javavm.cxx20
2 files changed, 4 insertions, 19 deletions
diff --git a/stoc/source/javavm/javavm.component b/stoc/source/javavm/javavm.component
index 79d993ddd62c..71379052b89e 100644
--- a/stoc/source/javavm/javavm.component
+++ b/stoc/source/javavm/javavm.component
@@ -20,7 +20,8 @@
<component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@"
xmlns="http://openoffice.org/2010/uno-components">
<implementation name="com.sun.star.comp.stoc.JavaVirtualMachine"
- constructor="stoc_JavaVM_get_implementation">
+ constructor="stoc_JavaVM_get_implementation"
+ single-instance="true">
<service name="com.sun.star.java.JavaVirtualMachine"/>
<singleton name="com.sun.star.java.theJavaVirtualMachine"/>
</implementation>
diff --git a/stoc/source/javavm/javavm.cxx b/stoc/source/javavm/javavm.cxx
index 19bce9f5f2cd..35fc0cb9c7d9 100644
--- a/stoc/source/javavm/javavm.cxx
+++ b/stoc/source/javavm/javavm.cxx
@@ -1471,29 +1471,13 @@ void JavaVirtualMachine::handleJniException(JNIEnv * environment) {
}
-static osl::Mutex m_aMutex;
-static rtl::Reference< JavaVirtualMachine > m_xSingleton;
-
-
-void JavaVirtualMachine::dispose() {
- JavaVirtualMachine_Impl::dispose();
- osl::MutexGuard aGuard(m_aMutex);
- m_xSingleton.clear();
-}
+void JavaVirtualMachine::dispose() {}
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
stoc_JavaVM_get_implementation(
css::uno::XComponentContext* context , css::uno::Sequence<css::uno::Any> const&)
{
- // Only one single instance of this service is ever constructed, and is
- // available until the component context used to create this instance is
- // disposed. Afterwards, this function throws a DisposedException (as do
- // all relevant methods on the single service instance).
- osl::MutexGuard aGuard(m_aMutex);
- if (!m_xSingleton.is())
- m_xSingleton.set(new JavaVirtualMachine(context));
- m_xSingleton->acquire();
- return static_cast<cppu::OWeakObject*>(m_xSingleton.get());
+ return static_cast<cppu::OWeakObject*>(new JavaVirtualMachine(context));
}
ntegration" to create the compile_commands.json file required by the vscode integration. Not using the autogenerated file created by configure directly might also spare some users from having their own additions overridden Change-Id: Ibb269197dc84f607b28ddad03adc919864e0c040 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126860 Tested-by: Jenkins Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> 2021-12-16VSCode IDE integration: add safe path for pretty printersMike Kaganski Change-Id: I900ea4aef58fddb21f8bf3cb8264d9c8d9169a9c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126873 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> 2021-05-31vscode: tell gitlens how to linkifiy our buglinks in commitsChristian Lohmaier Change-Id: I7cc8efa94f75581d30047abf5c401b68741fb2a1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116342 Tested-by: Jenkins Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> 2021-05-19tell vscode to treat our patch.<level> files as diffsChristian Lohmaier Change-Id: I770d97b409cd42b4ef697fbde352cb147fa3a995 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115807 Tested-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> 2021-02-13vscode: make it work better when srcdir=buildir and add mac lldb configChristian Lohmaier Change-Id: I75b7104c98d187353bc3950ad51877f10ae04760 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110838 Tested-by: Jenkins Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> 2020-12-15add a visual studio code workspace template (created by configure.ac)Christian Lohmaier Not having settings directly stored in .vscode directory in the repository/having the files ignored there is a problem when you build in a separate builddirectory and you regularly do a full reset of your sourcedir using "git clean -fdx" and similar. If you had any folder-settings, you'd lose them that way. VS Code doesn't really have a mechanism to include and then extend repository defaults, but it has three different tiers where settings are pulled from: folder, workspace and user For LibreOffice core repository there are no folder settings as our .vscode is not populated (or at least it is not stable), a user can of course place a settings.json or other configuration files in their checkout, just with the "git clean" problem mentioned above. This patch adds a workspace configuration - that file can be stored anywhere and instead references the folders to use as configuration items. If you want to add your own launch configuration or tasks: you can just store it on your desktop, and can completely wipe out your builddir as well as prune your srcdir - if you reuse the same paths for your next build, you can simply reopen that workspace file and have all your settings applied. Having it part of the core repository and created by configure from the template is thus just a convenience thing - it has a launch-in-debugger rule and settings for code search/browsing that should be all that's needed/all that's specific to LibreOffice at least. Change-Id: I8625d83d0c30c2668b99ec672c651c3d35258ca5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107655 Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org> Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> Tested-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>