AcademySoftwareFoundation / MaterialX

MaterialX is an open standard for the exchange of rich material and look-development content across applications and renderers.
http://www.materialx.org/
Apache License 2.0
1.84k stars 350 forks source link

Fix memory leaks in viewer and graph editor #1571

Open erikaharrison-adsk opened 11 months ago

erikaharrison-adsk commented 11 months ago

Steps to Reproduce (latest version of main branch):

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)

jstone-lucasfilm commented 11 months ago

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

hridizaroy commented 1 week ago

Hi, this is Hridiza. Just noting here that I'll be trying to tackle this issue for dev days!

jstone-lucasfilm commented 1 week ago

Welcome @hridizaroy!

jstone-lucasfilm commented 4 days ago

I'm linking this task to @hridizaroy's first PR, which has now been merged to main. Thanks Hridiza!

https://github.com/AcademySoftwareFoundation/MaterialX/pull/2043