Skip to content

Commit

Permalink
Ensure we don't register the TfNotice callback twice MAXTOA-1824 (#2089)
Browse files Browse the repository at this point in the history
* Ensure we don't register the TfNotice callback twice MAXTOA-1824

* Update changelog

* Fix changelog
  • Loading branch information
sebastienblor authored Sep 9, 2024
1 parent 9e9b8d0 commit 7e33159
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
# Changelog

## Pending next bugfix release
- [usd#2090](https://github.com/Autodesk/arnold-usd/issues/2090) - Fixed crashes when registering the TfNotice callback multiple times

## [7.3.4.0] - 2024-08-30
- [usd#2075](https://github.com/Autodesk/arnold-usd/issues/2075) - Ensure options attributes are not set while a hydra render is in progress

## [7.3.3.1] - 2024-08-09
Expand Down
7 changes: 5 additions & 2 deletions libs/translator/reader/reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -568,9 +568,12 @@ void UsdArnoldReader::ReadStage(UsdStageRefPtr stage, const std::string &path)
// to be informed of the interactive changes happening in the UsdStage
// (which must be kept in memory)
if (_interactive) {
_objectsChangedNoticeKey =
TfNotice::Register(TfCreateWeakPtr(&_listener),
// only register the callback if it wasn't already done
if (!_objectsChangedNoticeKey.IsValid()) {
_objectsChangedNoticeKey =
TfNotice::Register(TfCreateWeakPtr(&_listener),
&StageListener::_OnUsdObjectsChanged, _stage);
}
// The eventual "root path" is needed, since we want to ignore changes
// that aren't part of it
_listener._rootPath = _hasRootPrim ? _rootPrim.GetPath() : SdfPath();
Expand Down

0 comments on commit 7e33159

Please sign in to comment.