summaryrefslogtreecommitdiffstats
path: root/signal-composer-binding/clientApp.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'signal-composer-binding/clientApp.cpp')
-rw-r--r--signal-composer-binding/clientApp.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/signal-composer-binding/clientApp.cpp b/signal-composer-binding/clientApp.cpp
index 854f96e..45c43e6 100644
--- a/signal-composer-binding/clientApp.cpp
+++ b/signal-composer-binding/clientApp.cpp
@@ -25,9 +25,13 @@ clientAppCtx::clientAppCtx(const char* uuid)
void clientAppCtx::update(Signal* sig)
{
json_object* sigJ = sig->toJSON();
- if(afb_event_push(event_, sigJ) == 0)
- {sig->delObserver(this);}
- return;
+
+ if(afb_event_is_valid(event_)) {
+ if(!afb_event_push(event_, sigJ))
+ {sig->delObserver(this);}
+ }
+ else
+ {json_object_put(sigJ);}
}
void clientAppCtx::appendSignals(std::vector<std::shared_ptr<Signal>>& sigV)