EMSUSD-622 - As a user, I'd like to add a relative sublayer on a anonymous layer#3353
Merged
seando-adsk merged 4 commits intodevfrom Oct 2, 2023
Merged
EMSUSD-622 - As a user, I'd like to add a relative sublayer on a anonymous layer#3353seando-adsk merged 4 commits intodevfrom
seando-adsk merged 4 commits intodevfrom
Conversation
lib/mayaUsd/utils/utilFileSystem.cpp
Outdated
| return uniqueName; | ||
| } | ||
|
|
||
| static std::map<PXR_NS::SdfLayerHandle, std::set<ghc::filesystem::path>> sPostponedRelativePaths; |
Collaborator
There was a problem hiding this comment.
I know that it is not multi-thread safe anyway, but just for order-of-initilization of C++ globals, it is a better practice to put the static variable inside a static function that returns it because the C++ language standard guarantee hat the static will be initialized on first call (which avoid the order of init of globals problem) and ensure that this init is thread-safe.
So something like:
using RelativePaths = std::map<PXR_NS::SdfLayerHandle, std::set<ghc::filesystem::path>>;
static RelativePaths& getRelativePaths()
{
static RelativePaths sPaths;
return sPaths;
}
pierrebai-adsk
requested changes
Sep 28, 2023
Collaborator
pierrebai-adsk
left a comment
There was a problem hiding this comment.
Small change requested to make it safer vs C++ link order.
Otherwise, looks good to me.
pierrebai-adsk
approved these changes
Sep 29, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.