summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsrc/base/watch_base.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/base/watch_base.c b/src/base/watch_base.c
index 73b4beb..8b8bb26 100755
--- a/src/base/watch_base.c
+++ b/src/base/watch_base.c
@@ -586,6 +586,8 @@ int __on_change_signal(const char *endpoint, aul_app_com_result_e e,
_E("mode is nullptr");
return 0;
}
+ if (__context.extra)
+ bundle_free(__context.extra);
__context.extra = bundle_decode((bundle_raw *)extra, strlen(extra));
__handling_ambient_mode(atoi(mode), NULL);
@@ -616,8 +618,10 @@ static void __unset_ambient_changed_cb()
__context.conn = NULL;
}
- if (__context.extra)
+ if (__context.extra) {
bundle_free(__context.extra);
+ __context.extra = NULL;
+ }
}
static int __on_ui_base_create(void *data)
@@ -1066,6 +1070,8 @@ EXPORT_API int watch_base_init(int argc, char **argv,
__context.ambient_mode_skip_resume = false;
__context.data = user_data;
__context.state = WATCH_BASE_STATE_CREATING;
+ if (__context.extra)
+ bundle_free(__context.extra);
__context.extra = NULL;
return appcore_ui_base_init(ops, argc, argv, NULL, 0);