cburstedde / p4est

The "p4est" forest-of-octrees library

Home Page:www.p4est.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Memory leak during VTK write

ligazetom opened this issue · comments

Description
Memory leak (caught by sc) happens during VTK cell data writing, if you don't write out rank and/or level. I checked versions from master 2.2 as well as from develop branch and it happens in all of them.

This is caused by deallocating variables locidx_data and uint8_data during normal execution only inside of if statements for the respective arguments. That is why you need both, level and rank to be 1. If either one of them is 0, one of the variables won't get deallocated.

To Reproduce
This is minimal failing example (edited step1, you need hw32.h as well).

vtk_minimal_fail.zip

Additional information
I will create PR to fix this, just wanted to create issue first, so anyone else can confirm.

Good point, will look at PR. Thanks!