Commit 38a09f9c authored by Sebastian Lackner's avatar Sebastian Lackner Committed by Alexandre Julliard

services: Hold scmdatabase lock while checking marked_for_delete.

parent 4a3d7126
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment