Skip to content

Commit aa09078

Browse files
ohjaypixar-oss
authored andcommitted
Fix null riley crash in Finalize() for volumes and volume filters.
_riley can get nulled out from renderer teardown before Finalize() completes, so we have to guard against that. See also 2398584. (Internal change: 2403787)
1 parent c42a0b4 commit aa09078

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

third_party/renderman/plugin/hdPrman/volume.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,10 @@ HdPrman_Volume::Finalize(HdRenderParam *renderParam)
209209
if (!_volumeFilterIds.empty()) {
210210
auto* param = static_cast<HdPrman_RenderParam*>(renderParam);
211211
riley::Riley* riley = param->AcquireRiley();
212-
for (const auto& filterId : _volumeFilterIds) {
213-
riley->DeleteVolumeFilter(filterId);
212+
if (riley) {
213+
for (const auto& filterId : _volumeFilterIds) {
214+
riley->DeleteVolumeFilter(filterId);
215+
}
214216
}
215217
_volumeFilterIds.clear();
216218
}

third_party/renderman/plugin/hdPrman/volumeFilter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ HdPrman_VolumeFilter::Finalize(HdRenderParam *renderParam)
5252
std::lock_guard<std::mutex> lock(_syncToRileyMutex);
5353
auto* param = static_cast<HdPrman_RenderParam*>(renderParam);
5454
riley::Riley *riley = param->AcquireRiley();
55-
if (_coordSysId != riley::CoordinateSystemId::InvalidId()) {
55+
if (riley && _coordSysId != riley::CoordinateSystemId::InvalidId()) {
5656
riley->DeleteCoordinateSystem(_coordSysId);
5757
_coordSysId = riley::CoordinateSystemId::InvalidId();
5858
}

0 commit comments

Comments
 (0)