diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2019-04-26 11:46:51 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2019-04-26 22:47:05 +0200 |
commit | ac419786b3244d909901db053841862abf5e7a2f (patch) | |
tree | 5dba1043e19cc431fd11c727d167e88a9808287e /comphelper | |
parent | 8a53befea7cfe75bbd946cef281b922c30c87386 (diff) |
Don't use std::function in scope guard for performance reasons
Change-Id: I1d2f0307c0bf9ff5abde74d3326899a1aaa69c40
Reviewed-on: https://gerrit.libreoffice.org/71346
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'comphelper')
-rw-r--r-- | comphelper/Library_comphelper.mk | 1 | ||||
-rw-r--r-- | comphelper/source/misc/scopeguard.cxx | 58 |
2 files changed, 0 insertions, 59 deletions
diff --git a/comphelper/Library_comphelper.mk b/comphelper/Library_comphelper.mk index a5275f971be4..62b59e0f72de 100644 --- a/comphelper/Library_comphelper.mk +++ b/comphelper/Library_comphelper.mk @@ -124,7 +124,6 @@ $(eval $(call gb_Library_add_exception_objects,comphelper,\ comphelper/source/misc/profilezone \ comphelper/source/misc/proxyaggregation \ comphelper/source/misc/random \ - comphelper/source/misc/scopeguard \ comphelper/source/misc/SelectionMultiplex \ comphelper/source/misc/sequenceashashmap \ comphelper/source/misc/sequence \ diff --git a/comphelper/source/misc/scopeguard.cxx b/comphelper/source/misc/scopeguard.cxx deleted file mode 100644 index 04c697c940be..000000000000 --- a/comphelper/source/misc/scopeguard.cxx +++ /dev/null @@ -1,58 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - - -#include <comphelper/flagguard.hxx> -#include <osl/diagnose.h> -#include <sal/log.hxx> -#include <com/sun/star/uno/Exception.hpp> - -namespace comphelper { - -ScopeGuard::~ScopeGuard() -{ - if (!m_func) - return; - try { - m_func(); - } - catch (css::uno::Exception & exc) { - SAL_WARN( "comphelper", "UNO exception occurred: " << exc ); - } - catch (...) { - OSL_FAIL( "unknown exception occurred!" ); - } -} - -void ScopeGuard::dismiss() -{ - m_func = nullptr; -} - -FlagGuard::~FlagGuard() -{ -} - -FlagRestorationGuard::~FlagRestorationGuard() -{ -} - -} // namespace comphelper - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |