mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-31 12:54:13 +00:00
services: Hold scmdatabase lock while checking marked_for_delete.
Signed-off-by: Sebastian Lackner <sebastian@fds-team.de> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
4a3d712608
commit
38a09f9c7b
1 changed files with 5 additions and 3 deletions
|
@ -456,13 +456,15 @@ struct service_entry *scmdatabase_find_service_by_displayname(struct scmdatabase
|
|||
|
||||
void release_service(struct service_entry *service)
|
||||
{
|
||||
struct scmdatabase *db = service->db;
|
||||
|
||||
scmdatabase_lock(db);
|
||||
if (InterlockedDecrement(&service->ref_count) == 0 && is_marked_for_delete(service))
|
||||
{
|
||||
scmdatabase_lock(service->db);
|
||||
scmdatabase_remove_service(service->db, service);
|
||||
scmdatabase_unlock(service->db);
|
||||
scmdatabase_remove_service(db, service);
|
||||
free_service_entry(service);
|
||||
}
|
||||
scmdatabase_unlock(db);
|
||||
}
|
||||
|
||||
static DWORD scmdatabase_create(struct scmdatabase **db)
|
||||
|
|
Loading…
Reference in a new issue