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

Spinell/maya 110157/clearing mutiple layer crash #1274

Merged
merged 3 commits into from
Mar 24, 2021

Conversation

spinell-adsk
Copy link
Contributor

@spinell-adsk spinell-adsk commented Mar 24, 2021

  • Remove warning comfirmation dialog box when clearing a layer. (That cause the Layer editor to refresh when clearing multiple layer which can cause a dangling pointer and crash)
  • Suspend Usd Notices until all layers are cleared.

When clearing multiple layer at the same time, maya crash because of a dangling pointer. This happen when in the selected layers, there is a sub layer of another layer. When clearing layers, we are first getting a list of all selected layers than loop over the list and clear layer one by one (Same pattern as remove layer). The problem here is after the first clear, we are notified by USD that a layer changed and we are queuing a Layer Editor refresh on idle. On the next loop iteration, items can become a dangling pointer to an object that have been deleted if the Layer Editor refresh already happen (During the refresh all the items are deleted are recreated).

Let suppose you have the fallowing hierarchy:
  layer1
   layer2
    layer3
     layer4

If all layers are selected and layer1 is cleared first, sub layer2 is removed from layer1 and a Layer Editor refresh callback is set on idle. If the refresh happen before we finish to iterate on the selected items, the selection list will contains dangling pointer.

To be sure the Layer Editor is not refreshing before we finish to clear all layers, I'm disabling USD notification and I'm forcing a refresh after all layer are cleared.

Note :
Before clearing each layer, a warning dialog box is displayed and maya become idle so the Layer Editor get refresh and the selection list become invalidate. I spoke with Natalia and we conclude that displayed a warning dialog box when clearing a layer does not really make sense because this operation is undo-able and we don't display a warning when removing a layer. So I removed the confirmation box.

- Remove warning comfirmation dialog box when clearing a layer. (That cause the Layer editor to refresh when clearing multiple layer which can cause a dagling pointer and crash)
- Avoid Layer editor refresh while clearing layers
@kxl-adsk kxl-adsk added the workflows Related to in-context workflows label Mar 24, 2021
Copy link
Collaborator

@seando-adsk seando-adsk left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@spinell-adsk spinell-adsk added the ready-for-merge Development process is finished, PR is ready for merge label Mar 24, 2021
@kxl-adsk kxl-adsk merged commit adef2db into dev Mar 24, 2021
@kxl-adsk kxl-adsk deleted the spinell/MAYA-110157/clearing_mutiple_layer_crash branch March 24, 2021 20:34
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