From 341831da4da448392d62e48f1a4f419a18e3dca5 Mon Sep 17 00:00:00 2001 From: Bui Nguyen Quoc Thanh Date: Wed, 13 Mar 2019 15:41:44 +0700 Subject: daemon: Don't remove unregistered context If a context is defined and loaded from runtime context config file, that context won't be deleted/removed from dlt-daemon database until its parent application is unregistered. Signed-off-by: Bui Nguyen Quoc Thanh --- src/daemon/dlt-daemon.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/daemon/dlt-daemon.c') diff --git a/src/daemon/dlt-daemon.c b/src/daemon/dlt-daemon.c index b587ead..b4c82b0 100644 --- a/src/daemon/dlt-daemon.c +++ b/src/daemon/dlt-daemon.c @@ -2597,7 +2597,11 @@ int dlt_daemon_process_user_message_unregister_context(DltDaemon *daemon, daemon->ecuid, verbose); - if (context) { + /* In case the daemon is loaded with predefined contexts and its context + * unregisters, the context information will not be deleted from daemon's + * table until its parent application is unregistered. + */ + if (context && context->predefined == false) { /* Delete this connection entry from internal table*/ if (dlt_daemon_context_del(daemon, context, daemon->ecuid, verbose) == -1) { dlt_vlog(LOG_WARNING, -- cgit v1.2.1