How to reproduce:
1. Open the attached “IN-138218” project
2. Open the “Test” Scene
3. Open the “UIToolkitGradientsDemoLayout.xml” in the UI Builder and select the “#Gradient” element
4. In the UI Builder Inspector, scroll down to “Background” and change any of the Gradient settings, then save (CTRL + S)
5. With the UI Builder window open, go to File > Build Settings, select your target platform, and click "Build"
6. Observe the Console window
Actual result: An "Attempted to release an invalid texture (index=-1)." error is thrown
Expected result: There are no attempts in releasing an already released texture during build
Reproducible with: 2023.1.0a14, 6000.0.72f1, 6000.3.12f1, 6000.4.1f1, 6000.5.0b2, 6000.6.0a2
Reproducible on: Windows 11
Not reproducible on: No other environments tested
Notes:
- This only happens if the fillGradient API of the Painter2D was used in a manipulator on an element in the UI Builder
- It all works fine if the UI Builder window is closed (or invisible) during a build