loplugin:flatten in opencl

Change-Id: I9f45510eddb022013af751d232d4704432717ef6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91617
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin
2020-04-03 10:50:28 +02:00
parent af95bda66d
commit 1511c73aa4

View File

@@ -25,21 +25,21 @@ void OpenCLZone::hardDisable()
{ {
// protect ourselves from double calling etc. // protect ourselves from double calling etc.
static bool bDisabled = false; static bool bDisabled = false;
if (!bDisabled) if (bDisabled)
{ return;
bDisabled = true;
std::shared_ptr<comphelper::ConfigurationChanges> xChanges(comphelper::ConfigurationChanges::create()); bDisabled = true;
officecfg::Office::Common::Misc::UseOpenCL::set(false, xChanges);
xChanges->commit();
// Force synchronous config write std::shared_ptr<comphelper::ConfigurationChanges> xChanges(comphelper::ConfigurationChanges::create());
auto xConfProvider = css::configuration::theDefaultProvider::get(comphelper::getProcessComponentContext()); officecfg::Office::Common::Misc::UseOpenCL::set(false, xChanges);
css::uno::Reference<css::util::XFlushable> xFlushable(xConfProvider, css::uno::UNO_QUERY_THROW); xChanges->commit();
xFlushable->flush();
releaseOpenCLEnv(&openclwrapper::gpuEnv); // Force synchronous config write
} auto xConfProvider = css::configuration::theDefaultProvider::get(comphelper::getProcessComponentContext());
css::uno::Reference<css::util::XFlushable> xFlushable(xConfProvider, css::uno::UNO_QUERY_THROW);
xFlushable->flush();
releaseOpenCLEnv(&openclwrapper::gpuEnv);
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */