Re: [2/2] server: A being destroyed object may need to access other objects using a handle.
Dmitry Timoshkov <dmitry(a)baikal.ru> writes:
--- a/server/handle.c +++ b/server/handle.c @@ -165,7 +165,6 @@ static void handle_table_destroy( struct object *obj ) for (i = 0, entry = table->entries; i <= table->last; i++, entry++) { struct object *obj = entry->ptr; - entry->ptr = NULL; if (obj) release_object( obj );
You can't do that, the object can't be accessed after being released. -- Alexandre Julliard julliard(a)winehq.org
Alexandre Julliard <julliard(a)winehq.org> wrote:
--- a/server/handle.c +++ b/server/handle.c @@ -165,7 +165,6 @@ static void handle_table_destroy( struct object *obj ) for (i = 0, entry = table->entries; i <= table->last; i++, entry++) { struct object *obj = entry->ptr; - entry->ptr = NULL; if (obj) release_object( obj );
You can't do that, the object can't be accessed after being released.
Being released doesn't mean destroyed. An object gets destroyed only if its refcount drops to 0. -- Dmitry.
Dmitry Timoshkov <dmitry(a)baikal.ru> writes:
Alexandre Julliard <julliard(a)winehq.org> wrote:
--- a/server/handle.c +++ b/server/handle.c @@ -165,7 +165,6 @@ static void handle_table_destroy( struct object *obj ) for (i = 0, entry = table->entries; i <= table->last; i++, entry++) { struct object *obj = entry->ptr; - entry->ptr = NULL; if (obj) release_object( obj );
You can't do that, the object can't be accessed after being released.
Being released doesn't mean destroyed. An object gets destroyed only if its refcount drops to 0.
Obviously, but in general the handle will be the only reference. -- Alexandre Julliard julliard(a)winehq.org
Alexandre Julliard <julliard(a)winehq.org> wrote:
--- a/server/handle.c +++ b/server/handle.c @@ -165,7 +165,6 @@ static void handle_table_destroy( struct object *obj ) for (i = 0, entry = table->entries; i <= table->last; i++, entry++) { struct object *obj = entry->ptr; - entry->ptr = NULL; if (obj) release_object( obj );
You can't do that, the object can't be accessed after being released.
Being released doesn't mean destroyed. An object gets destroyed only if its refcount drops to 0.
Obviously, but in general the handle will be the only reference.
Then I don't understand what you mean regarding the code snippet above. -- Dmitry.
Dmitry Timoshkov <dmitry(a)baikal.ru> writes:
Alexandre Julliard <julliard(a)winehq.org> wrote:
--- a/server/handle.c +++ b/server/handle.c @@ -165,7 +165,6 @@ static void handle_table_destroy( struct object *obj ) for (i = 0, entry = table->entries; i <= table->last; i++, entry++) { struct object *obj = entry->ptr; - entry->ptr = NULL; if (obj) release_object( obj );
You can't do that, the object can't be accessed after being released.
Being released doesn't mean destroyed. An object gets destroyed only if its refcount drops to 0.
Obviously, but in general the handle will be the only reference.
Then I don't understand what you mean regarding the code snippet above.
After release_object, the object will have been freed if this was the last reference. You can't keep a pointer to it. -- Alexandre Julliard julliard(a)winehq.org
Alexandre Julliard <julliard(a)winehq.org> wrote:
--- a/server/handle.c +++ b/server/handle.c @@ -165,7 +165,6 @@ static void handle_table_destroy( struct object *obj ) for (i = 0, entry = table->entries; i <= table->last; i++, entry++) { struct object *obj = entry->ptr; - entry->ptr = NULL; if (obj) release_object( obj );
You can't do that, the object can't be accessed after being released.
Being released doesn't mean destroyed. An object gets destroyed only if its refcount drops to 0.
Obviously, but in general the handle will be the only reference.
Then I don't understand what you mean regarding the code snippet above.
After release_object, the object will have been freed if this was the last reference. You can't keep a pointer to it.
If you know how to fix this properly - please go ahead, I won't be able to investigate this till next week. -- Dmitry.
participants (2)
-
Alexandre Julliard -
Dmitry Timoshkov