Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Fix testrender GPU regression with bad destruction order (Academ…
…ySoftwareFoundation#1814) A few months back, PR AcademySoftwareFoundation#1733 seems to have switched the order that testrender destroys the shading system versus the renderer (services). This made some subtle bugs that were only symptomatic for GPU renders, but it's because of the destructor order, where the shadingsystem's dtr still references the renderer, which cannot be destroyed yet. The clue is that the SS's constructor takes the RS pointer as an argument. The RS, then, must have been constructed before the SS, and therefore we should expect it to be a requirement for the RS to outlast the lifetime of the SS. (Complex objects should be destroyed in the opposite order that they were constructed, if they contain references to each other.) One code change is needed to avoid the sanitizer errors that the incorrect change was originally meant to address: clear shaders when SimpleRayTracer clears. Signed-off-by: Larry Gritz <[email protected]> --------- Signed-off-by: Larry Gritz <[email protected]>
- Loading branch information