void PkgSignal::Subscribe() {
std::lock_guard<std::recursive_mutex> lock(mutex_);
+ if (!event_add_event_handler) {
+ _E("Function symbol(event_add_event_handler) did not initialized");
+ throw InvalidIOException();
+ }
+
int ret = event_add_event_handler(GetEventName().c_str(), EventCb, this,
&event_handler_);
if (ret != 0) {
void PkgSignal::Unsubscribe() {
std::lock_guard<std::recursive_mutex> lock(mutex_);
if (event_handler_) {
- event_remove_event_handler(event_handler_);
+ if (event_remove_event_handler)
+ event_remove_event_handler(event_handler_);
event_handler_ = nullptr;
}
}
}
std::lock_guard<std::recursive_mutex> lock(mutex_);
+ if (!event_publish_app_event) {
+ _E("Function symbol(event_publish_app_event) did not initialized");
+ throw InvalidIOException();
+ }
int ret = event_publish_app_event(GetEventName().c_str(), b);
if (ret != 0) {
_E("Failed to publish event. result(%d)", ret);
}
std::lock_guard<std::recursive_mutex> lock(mutex_);
+ if (!event_publish_app_event) {
+ _E("Function symbol(event_publish_app_event) did not initialized");
+ throw InvalidIOException();
+ }
int ret = event_publish_app_event(GetEventName().c_str(), b);
if (ret != 0) {
_E("Failed to publish event. result(%d)", ret);
}
std::lock_guard<std::recursive_mutex> lock(mutex_);
+ if (!event_publish_app_event) {
+ _E("Function symbol(event_publish_app_event) did not initialized");
+ throw InvalidIOException();
+ }
int ret = event_publish_app_event(GetEventName().c_str(), b);
if (ret != 0) {
_E("Failed to publish event. result(%d)", ret);