Skip Menu |

This queue is for tickets about the SOAP-Data-Builder CPAN distribution.

Report information
The Basics
Id: 95653
Status: new
Priority: 0/
Queue: SOAP-Data-Builder

People
Owner: Nobody in particular
Requestors: rrwo [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in:
  • 0.1
  • 0.2
  • 0.3
  • 0.4
  • 0.5
  • 0.6
  • 0.7
  • 0.8
  • 0.9
  • 1
Fixed in: (no value)



Subject: Circular references when using add_elem
Setting the parent attribute of elements adds a circular reference, which leads to memory leaks. This can be fixed by using Scalar::Util's weaken function and adding weaken( $elem->{parent} ) if ( ref $elem->{parent} ); after $parent->add_elem($elem); It's easy to test. You can use Test::Memory::Cycle in the test memory_cycle_ok($builder, "no memory cycles"); This test will fail if the $elem->{parent} attribute is not weakened. Fixes can be found in https://github.com/robrwo/SOAP-Data-Builder/commits/fix-memory-leak