Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EMSUSD-622 - As a user, I'd like to add a relative sublayer on a anonymous layer #3353

Merged
merged 4 commits into from
Oct 2, 2023

Conversation

vlasovi
Copy link
Collaborator

@vlasovi vlasovi commented Sep 28, 2023

No description provided.

@@ -48,6 +48,9 @@ std::string generateUniqueName()
}
return uniqueName;
}

static std::map<PXR_NS::SdfLayerHandle, std::set<ghc::filesystem::path>> sPostponedRelativePaths;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;
}

Copy link
Collaborator

@pierrebai-adsk pierrebai-adsk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small change requested to make it safer vs C++ link order.

Otherwise, looks good to me.

@vlasovi vlasovi added the ready-for-merge Development process is finished, PR is ready for merge label Sep 29, 2023
@seando-adsk seando-adsk added the workflows Related to in-context workflows label Oct 2, 2023
@seando-adsk seando-adsk merged commit bee6786 into dev Oct 2, 2023
11 checks passed
@seando-adsk seando-adsk deleted the vlasovi/EMSUSD-622 branch October 2, 2023 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-merge Development process is finished, PR is ready for merge workflows Related to in-context workflows
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants