MaterialX icon indicating copy to clipboard operation
MaterialX copied to clipboard

Fix memory leaks in viewer and graph editor

Open erikaharrison-adsk opened this issue 2 years ago • 4 comments

Steps to Reproduce (latest version of main branch):

  • Launch the MaterialXGraphEditor or MaterialXView viewer in Debug (Windows x64)
  • File > Open or Load Material and select either:
    • Rook: https://github.com/usd-wg/assets/blob/main/full_assets/OpenChessSet/assets/Rook/Rook_mat.mtlx
    • Knight: https://github.com/usd-wg/assets/blob/main/full_assets/OpenChessSet/assets/Knight/Knight_mat.mtlx
  • Close the application (X in the top right corner)

Expected results: Exits normally. Actual results: Reports memory leaks and dumps objects.

eg. for Rook in the MaterialXViewer, I get a small list

Detected memory leaks!
Dumping objects ->
{4902673} normal block at 0x0000015784728A00, 3 bytes long.
 Data: <   > 00 02 02 
{4902670} normal block at 0x000001579C64BDD0, 16 bytes long.
 Data: <H8  W           > 48 38 93 84 57 01 00 00 00 00 00 00 00 00 00 00 
{4902669} normal block at 0x000001579C64C410, 16 bytes long.
 Data: <(8  W           > 28 38 93 84 57 01 00 00 00 00 00 00 00 00 00 00 
{4902668} normal block at 0x0000015784933810, 104 bytes long.
 Data: <  <             > B0 EC 3C 81 F6 7F 00 00 01 00 00 00 00 00 00 00 
{3283350} normal block at 0x00000157845BB570, 16 bytes long.
 Data: < l              > 10 6C 9C 84 FF 7F 00 00 01 00 00 00 CD CD CD CD 
Object dump complete.
The program '[30396] MaterialXView.exe' has exited with code 0 (0x0).

But in the MaterialXGraphEditor, both give a huge list of leaks (have not copied list)

erikaharrison-adsk avatar Oct 13 '23 22:10 erikaharrison-adsk

These are great observations, @erikaharrison-adsk, and definitely worthy of future investigation and improvements to the viewer and graph editor.

jstone-lucasfilm avatar Oct 14 '23 19:10 jstone-lucasfilm