summaryrefslogtreecommitdiff
path: root/src/lib/efreet/efreet_desktop.c
diff options
context:
space:
mode:
authorSebastian Dransfeld <sd@tango.flipp.net>2013-11-29 22:18:51 +0100
committerSebastian Dransfeld <sd@tango.flipp.net>2013-11-29 22:20:50 +0100
commit575f466a1022b1827d7cbbf6f205d3ee674f4bec (patch)
treedc6b1e56f6803b66755367043f5564850f5b921e /src/lib/efreet/efreet_desktop.c
parentcc4aedaaeee41afcb83c522e69eac8f9e4f76466 (diff)
efreet: improve locking
Do find and ref inside lock, so no one can ref-- after we find desktop
Diffstat (limited to '')
-rw-r--r--src/lib/efreet/efreet_desktop.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lib/efreet/efreet_desktop.c b/src/lib/efreet/efreet_desktop.c
index 9c4c4e7fed..dab5e56264 100644
--- a/src/lib/efreet/efreet_desktop.c
+++ b/src/lib/efreet/efreet_desktop.c
@@ -213,11 +213,11 @@ efreet_desktop_new(const char *file)
213 tmp = eina_file_path_sanitize(file); 213 tmp = eina_file_path_sanitize(file);
214 if (!tmp) return NULL; 214 if (!tmp) return NULL;
215 215
216 eina_lock_take(&_lock);
216 desktop = efreet_cache_desktop_find(tmp); 217 desktop = efreet_cache_desktop_find(tmp);
217 free(tmp); 218 free(tmp);
218 if (desktop) 219 if (desktop)
219 { 220 {
220 eina_lock_take(&_lock);
221 desktop->ref++; 221 desktop->ref++;
222 eina_lock_release(&_lock); 222 eina_lock_release(&_lock);
223 if (!efreet_desktop_environment_check(desktop)) 223 if (!efreet_desktop_environment_check(desktop))
@@ -227,6 +227,7 @@ efreet_desktop_new(const char *file)
227 } 227 }
228 return desktop; 228 return desktop;
229 } 229 }
230 eina_lock_release(&_lock);
230 return efreet_desktop_uncached_new(file); 231 return efreet_desktop_uncached_new(file);
231} 232}
232 233