summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJuergen Gehring <juergen.gehring@bmw.de>2018-01-25 01:01:22 -0800
committerJuergen Gehring <juergen.gehring@bmw.de>2018-01-25 01:01:22 -0800
commit2fd0625d21f1fa8e6a3adfc89ce9f381a4d33990 (patch)
tree373a6c991944c700ee3ff1fe872daa3f751281d8 /include
parent2c259a9cbfa8fbde71ebc62d45684c375311f4fc (diff)
downloadgenivi-common-api-runtime-2fd0625d21f1fa8e6a3adfc89ce9f381a4d33990.tar.gz
capicxx-core-runtime 3.1.12.43.1.12.4
Diffstat (limited to 'include')
-rw-r--r--include/CommonAPI/Event.hpp5
-rw-r--r--include/CommonAPI/Variant.hpp4
2 files changed, 6 insertions, 3 deletions
diff --git a/include/CommonAPI/Event.hpp b/include/CommonAPI/Event.hpp
index 67cc6dc..ab656f8 100644
--- a/include/CommonAPI/Event.hpp
+++ b/include/CommonAPI/Event.hpp
@@ -115,8 +115,11 @@ typename Event<Arguments_...>::Subscription Event<Arguments_...>::subscribe(List
pendingSubscriptions_[subscription] = std::move(listeners);
subscriptionMutex_.unlock();
- if (isFirstListener)
+ if (isFirstListener) {
+ if (!pendingUnsubscriptions_.empty())
+ onLastListenerRemoved(listener);
onFirstListenerAdded(listener);
+ }
onListenerAdded(listener, subscription);
return subscription;
diff --git a/include/CommonAPI/Variant.hpp b/include/CommonAPI/Variant.hpp
index 8ae9e6c..db1cf7b 100644
--- a/include/CommonAPI/Variant.hpp
+++ b/include/CommonAPI/Variant.hpp
@@ -710,11 +710,11 @@ const Type_ & Variant<Types_...>::get() const {
if (itsType == valueType_) {
return *(reinterpret_cast<const Type_ *>(&valueStorage_));
} else {
-#ifdef __EXCEPTIONS
+#if defined(__EXCEPTIONS) || defined(_CPPUNWIND)
std::bad_cast toThrow;
throw toThrow;
#else
- printf("SerializableVariant.hpp:%i %s: Incorrect access to variant; attempting to get type not currently contained", __LINE__, __FUNCTION__);
+ printf("Variant.hpp:%i %s: Incorrect access to variant; attempting to get type not currently contained", __LINE__, __FUNCTION__);
abort();
#endif
}