Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the OX CPAN distribution.

Report information
The Basics
Id: 84645
Status: resolved
Priority: 0/
Queue: OX

People
Owner: Nobody in particular
Requestors: roman.daniel [...] davosro.cz
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.10
Fixed in: (no value)



Subject: There is a circular reference in OX
Once you create the OX application, the object is never released due to circular reference. use strict; use Test::More; use Scalar::Util qw(weaken); { package MyApp; use OX; } my $weak = MyApp->new; weaken($weak); ok(!$weak, 'reference is cleared'); done_testing(); As far as I was able to detect it the problem lies in a container construction in OX/Application/Role/Router.pm lines 28: my $router = $self->build_router($s); 29: $self->configure_router($router); and OX/Application.pm lines 36: $self->build_middleware($s); 45: my $app = $self->build_app($s); 65: $self->_flush_request_services where the container ($self) is referenced inside block subroutine. When you replace $self by $s->parent you break the circular reference and the test passes.
Fixed in 0.11.