Skip to content

Commit

Permalink
UI: Fix crash when creating scene collections with "unsafe" names
Browse files Browse the repository at this point in the history
Scene collection names that are not considered "safe" by OBS Studio
get a changed JSON file name with incompatible characters replaced.

The refactored scene collection implementation uses the Load function to
either activate an existing scene collection or create a new one if it
does not exist.

The Load function however overwrote the scene collection name set in
the profile with its own variant based off the "safe" file name, which
created a mismatch with the code that created the collection data
model.

As the Load function is only called by ActivateSceneCollection (which
itself already sets the name and filename for the collection), removal
of this superfluous code in the Load function also fixes the issue.
  • Loading branch information
PatTheMav authored and RytoEX committed Sep 27, 2024
1 parent 6fed2c2 commit b4137fa
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions UI/window-basic-main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1246,10 +1246,6 @@ void OBSBasic::Load(const char *file, bool remigrate)
}
}

config_set_string(App()->GetUserConfig(), "Basic",
"SceneCollection", name.c_str());
config_set_string(App()->GetUserConfig(), "Basic",
"SceneCollectionFile", name.c_str());
blog(LOG_INFO, "No scene file found, creating default scene");

bool hasFirstRun = config_get_bool(App()->GetUserConfig(),
Expand Down

0 comments on commit b4137fa

Please sign in to comment.