You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@celix.apache.org by pn...@apache.org on 2020/02/23 14:43:56 UTC

[celix] branch develop updated: Add missing nothrow specifier to new operator as code suggests

This is an automated email from the ASF dual-hosted git repository.

pnoltes pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/celix.git


The following commit(s) were added to refs/heads/develop by this push:
     new 68654dd  Add missing nothrow specifier to new operator as code suggests
     new 7b0a461  Merge pull request #155 from Oipo/bugfix/missing_std_nothrow
68654dd is described below

commit 68654dd9b710069683a8cf546264f43df4ec5567
Author: Michael de Lang <ki...@gmail.com>
AuthorDate: Fri Feb 21 21:38:57 2020 +0100

    Add missing nothrow specifier to new operator as code suggests
---
 libs/framework/include/celix_bundle_activator.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libs/framework/include/celix_bundle_activator.h b/libs/framework/include/celix_bundle_activator.h
index 7f71ad7..52c9328 100644
--- a/libs/framework/include/celix_bundle_activator.h
+++ b/libs/framework/include/celix_bundle_activator.h
@@ -165,9 +165,9 @@ extern "C" celix_status_t bundleActivator_create(celix_bundle_context_t *context
     int status = CELIX_SUCCESS;                                                                                        \
                                                                                                                        \
     BundleActivatorData* data = nullptr;                                                                               \
-    data = new BundleActivatorData{};                                                                                  \
+    data = new (std::nothrow) BundleActivatorData{};                                                                                  \
     if (data != nullptr) {                                                                                             \
-        data->mng = std::shared_ptr<celix::dm::DependencyManager>{new celix::dm::DependencyManager{context}};          \
+        data->mng = std::shared_ptr<celix::dm::DependencyManager>{new (std::nothrow) celix::dm::DependencyManager{context}};          \
     }                                                                                                                  \
                                                                                                                        \
     if (data == nullptr || data->mng == nullptr) {                                                                     \