Commit 82c84548 authored by Alexandre Julliard's avatar Alexandre Julliard

server: Use OBJ_PERMANENT for permanent objects.

parent 5c4d6cf8
...@@ -293,11 +293,6 @@ static struct object *create_object( struct object *parent, const struct object_ ...@@ -293,11 +293,6 @@ static struct object *create_object( struct object *parent, const struct object_
name_ptr->obj = obj; name_ptr->obj = obj;
obj->name = name_ptr; obj->name = name_ptr;
if (attributes & OBJ_PERMANENT)
{
make_object_static( obj );
grab_object( obj );
}
return obj; return obj;
failed: failed:
...@@ -325,7 +320,7 @@ void *create_named_object( struct object *parent, const struct object_ops *ops, ...@@ -325,7 +320,7 @@ void *create_named_object( struct object *parent, const struct object_ops *ops,
free_object( new_obj ); free_object( new_obj );
return NULL; return NULL;
} }
return new_obj; goto done;
} }
if (!(obj = lookup_named_object( parent, name, attributes, &new_name ))) return NULL; if (!(obj = lookup_named_object( parent, name, attributes, &new_name ))) return NULL;
...@@ -348,6 +343,13 @@ void *create_named_object( struct object *parent, const struct object_ops *ops, ...@@ -348,6 +343,13 @@ void *create_named_object( struct object *parent, const struct object_ops *ops,
new_obj = create_object( obj, ops, &new_name, attributes, sd ); new_obj = create_object( obj, ops, &new_name, attributes, sd );
release_object( obj ); release_object( obj );
done:
if (attributes & OBJ_PERMANENT)
{
make_object_static( new_obj );
grab_object( new_obj );
}
return new_obj; return new_obj;
} }
......
...@@ -1633,8 +1633,8 @@ DECL_HANDLER(make_process_system) ...@@ -1633,8 +1633,8 @@ DECL_HANDLER(make_process_system)
if (!shutdown_event) if (!shutdown_event)
{ {
if (!(shutdown_event = create_event( NULL, NULL, 0, 1, 0, NULL ))) return; if (!(shutdown_event = create_event( NULL, NULL, OBJ_PERMANENT, 1, 0, NULL ))) return;
make_object_static( (struct object *)shutdown_event ); release_object( shutdown_event );
} }
if (!(reply->event = alloc_handle( current->process, shutdown_event, SYNCHRONIZE, 0 ))) if (!(reply->event = alloc_handle( current->process, shutdown_event, SYNCHRONIZE, 0 )))
......
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