projects
/
profile
/
ivi
/
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
d389107
..
4d1ebaa
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);
}