diff --git a/src/libguac/client.c b/src/libguac/client.c index 71fa7f763..55cbc374d 100644 --- a/src/libguac/client.c +++ b/src/libguac/client.c @@ -146,12 +146,12 @@ guac_stream* guac_client_alloc_stream(guac_client* client) { void guac_client_free_stream(guac_client* client, guac_stream* stream) { - /* Release index to pool */ - guac_pool_free_int(client->__stream_pool, (stream->index - 1) / 2); - /* Mark stream as closed */ stream->index = GUAC_CLIENT_CLOSED_STREAM_INDEX; + /* Release index to pool */ + guac_pool_free_int(client->__stream_pool, (stream->index - 1) / 2); + } /** diff --git a/src/libguac/user.c b/src/libguac/user.c index 16baa169f..b6d44087a 100644 --- a/src/libguac/user.c +++ b/src/libguac/user.c @@ -126,12 +126,12 @@ guac_stream* guac_user_alloc_stream(guac_user* user) { void guac_user_free_stream(guac_user* user, guac_stream* stream) { - /* Release index to pool */ - guac_pool_free_int(user->__stream_pool, stream->index / 2); - /* Mark stream as closed */ stream->index = GUAC_USER_CLOSED_STREAM_INDEX; + /* Release index to pool */ + guac_pool_free_int(user->__stream_pool, stream->index / 2); + } guac_object* guac_user_alloc_object(guac_user* user) { @@ -157,12 +157,12 @@ guac_object* guac_user_alloc_object(guac_user* user) { void guac_user_free_object(guac_user* user, guac_object* object) { - /* Release index to pool */ - guac_pool_free_int(user->__object_pool, object->index); - /* Mark object as undefined */ object->index = GUAC_USER_UNDEFINED_OBJECT_INDEX; + /* Release index to pool */ + guac_pool_free_int(user->__object_pool, object->index); + } int guac_user_handle_instruction(guac_user* user, const char* opcode, int argc, char** argv) {