fix a memory leak introduced by 1f8cad5e5a1875de94d63ac91d8ded4d2282c62e
[catagits/Web-Simple.git] / lib / Web / Dispatch.pm
index 2a5a835..d34fe6e 100644 (file)
@@ -14,7 +14,7 @@ with 'Web::Dispatch::ToApp';
 has dispatch_app => (
   is => 'lazy', builder => sub { shift->dispatch_object->to_app }
 );
-has dispatch_object => (is => 'ro', required => 0);
+has dispatch_object => (is => 'ro', required => 0, weak_ref => 1);
 has parser_class => (
   is => 'ro', default => quote_sub q{ 'Web::Dispatch::Parser' }
 );