Revert "Fixed uninitialized vars in rooms created from templates"
This reverts commit 9bf795905f
.
ladish_room_create_interal() is suposed to allocate the struct and
initialize the name and uuid members. The template member is supposed to
be initialized by the caller functions, either ladish_room_create() or
ladish_room_create_template(). The siblings member is initialized
later, when the room is actually added to the appropriate list.
The graph member is used by both room templates and room objects. This
will be fixed in the following commit.
All other ladish_room members are not valid for room template objects.
This commit is contained in:
parent
1612b562af
commit
64923f3a86
|
@ -58,12 +58,6 @@ struct ladish_room * ladish_room_create_internal(const uuid_t uuid_ptr, const ch
|
|||
goto fail;
|
||||
}
|
||||
|
||||
room_ptr->project_name = NULL;
|
||||
room_ptr->project_dir = NULL;
|
||||
room_ptr->project_description = NULL;
|
||||
room_ptr->project_notes = NULL;
|
||||
room_ptr->project_state = ROOM_PROJECT_STATE_UNLOADED;
|
||||
|
||||
if (uuid_ptr != NULL)
|
||||
{
|
||||
uuid_copy(room_ptr->uuid, uuid_ptr);
|
||||
|
@ -88,8 +82,6 @@ struct ladish_room * ladish_room_create_internal(const uuid_t uuid_ptr, const ch
|
|||
log_error("strdup() failed for room name");
|
||||
goto free_name;
|
||||
}
|
||||
} else {
|
||||
room_ptr->object_path = NULL;
|
||||
}
|
||||
|
||||
if (!ladish_graph_create(&room_ptr->graph, object_path))
|
||||
|
@ -293,6 +285,12 @@ ladish_room_create(
|
|||
room_ptr->started = false;
|
||||
room_ptr->version = 1;
|
||||
|
||||
room_ptr->project_name = NULL;
|
||||
room_ptr->project_dir = NULL;
|
||||
room_ptr->project_description = NULL;
|
||||
room_ptr->project_notes = NULL;
|
||||
room_ptr->project_state = ROOM_PROJECT_STATE_UNLOADED;
|
||||
|
||||
if (template != NULL)
|
||||
{
|
||||
ladish_room_get_uuid(template, room_ptr->template_uuid);
|
||||
|
|
Loading…
Reference in New Issue