Skip to content

Cleanup memory allocated to child processes at the time of exit

Pritama Biswas requested to merge pritbisw/weston:memory_leak into main

The dynamic memory allocated to child processes is not cleaned up at the time of exit. This leads to memory leaks in weston. This change will deallocate the dynamically allocated memory on exit. I have used Valgrind tool to test the change and the result is as shown below.

Before using this change, the leak summary of Weston was:
==1115== LEAK SUMMARY:
==1115== definitely lost: 19,963 bytes in 36 blocks
==1115== indirectly lost: 13,112 bytes in 59 blocks
==1115== possibly lost: 143 bytes in 4 blocks
==1115== still reachable: 62,427 bytes in 116 blocks
==1115== suppressed: 0 bytes in 0 blocks

After this change, we can see that the possibly lost memory leaks are removed:
==1123== LEAK SUMMARY:
==1123== definitely lost: 19,953 bytes in 35 blocks
==1123== indirectly lost: 13,112 bytes in 59 blocks
==1123== possibly lost: 0 bytes in 0 blocks
==1123== still reachable: 62,427 bytes in 116 blocks
==1123== suppressed: 0 bytes in 0 blocks

Merge request reports