Closed forrestv closed 7 years ago
Running python3 Simple_Patch_Antenna.py
on current openEMS-Project HEAD results in the following error being displayed after all the plot windows are closed:
*** Error in `python3': double free or corruption (!prev): 0x0000000003202520 ***
This patch fixes it.
ContinuousStructure.__cinit__ creates an instance of CSRectGrid that does not own its contents, then tries to prevent it from freeing its contents by nulling its thisptr in ContinuousStructure.__dealloc__.
However, when reference cycles exist, ContinuousStructure.__dealloc__ is not guaranteed to be called before CSRectGrid.__dealloc__, since the garbage collector may call ContinuousStructure's tp_clear function (which frees the CSRectGrid instance).