Skip to content

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
vlasovi/EMSUSD-622
Oct 2, 2023
Merged

EMSUSD-622 - As a user, I'd like to add a relative sublayer on a anonymous layer#3353
seando-adsk merged 4 commits intodevfrom
vlasovi/EMSUSD-622

Conversation

@vlasovi
Copy link
Collaborator

@vlasovi vlasovi commented Sep 28, 2023

No description provided.

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
@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