Code Review
/
apps
/
agl-service-navigation.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
binding: navigation: move get_storage_from_value call within write lock
[apps/agl-service-navigation.git]
/
binding
/
navigation-api.c
diff --git
a/binding/navigation-api.c
b/binding/navigation-api.c
index
19913a1
..
ab7a5b7
100644
(file)
--- a/
binding/navigation-api.c
+++ b/
binding/navigation-api.c
@@
-135,10
+135,12
@@
static void broadcast(afb_req_t request, const char *name, gboolean cache)
json_object *jresp = afb_req_json(request);
if (cache) {
json_object *jresp = afb_req_json(request);
if (cache) {
- json_object **storage
= get_storage_from_value(ns, name)
;
+ json_object **storage;
g_rw_lock_writer_lock(&ns->rw_lock);
g_rw_lock_writer_lock(&ns->rw_lock);
+ storage = get_storage_from_value(ns, name);
+
if (*storage)
json_object_put(*storage);
if (*storage)
json_object_put(*storage);