projects
/
platform
/
upstream
/
connman.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
35c308f
)
Fix the reference counting for revived services
author
Marcel Holtmann
<marcel@holtmann.org>
Fri, 17 Jul 2009 10:08:34 +0000
(12:08 +0200)
committer
Marcel Holtmann
<marcel@holtmann.org>
Fri, 17 Jul 2009 10:08:34 +0000
(12:08 +0200)
src/service.c
patch
|
blob
|
history
diff --git
a/src/service.c
b/src/service.c
index d3891074d61bf07e1cb82db25aa6ec08b5c9cff7..4d1ebaadb582ec3bdd2925ec6c9c3683c1f16cb0 100644
(file)
--- a/
src/service.c
+++ b/
src/service.c
@@
-1589,9
+1589,13
@@
struct connman_service *__connman_service_create_from_network(struct connman_net
service = __connman_service_lookup_from_network(network);
if (service != NULL) {
- if (service->timeout > 0 && service->pending == NULL) {
- g_source_remove(service->timeout);
- service->timeout = 0;
+ if (g_atomic_int_get(&service->refcount) == 0) {
+ if (service->timeout > 0) {
+ g_source_remove(service->timeout);
+ service->timeout = 0;
+ }
+
+ connman_service_ref(service);
set_idle(service);
}