Author: spadkins
Date: Tue Nov 16 06:55:17 2010
New Revision: 14522

Modified:
   p5ee/trunk/App-Repository/lib/App/Repository.pm

Log:
enhance the DESTROY method to fix a bug with profiling

Modified: p5ee/trunk/App-Repository/lib/App/Repository.pm
==============================================================================
--- p5ee/trunk/App-Repository/lib/App/Repository.pm     (original)
+++ p5ee/trunk/App-Repository/lib/App/Repository.pm     Tue Nov 16 06:55:17 2010
@@ -4942,6 +4942,16 @@
 
 sub DESTROY {
     my $self = shift;
+    my $context  = $self->{context};
+    my $options  = $context->{options};
+    my $profiler = $options->{"app.Context.profiler"};
+    if ($profiler) {
+        my $profiler_repository = 
$options->{"app.Context.profiler_repository"} || "default";
+        if ($profiler_repository eq $self->{name}) {
+            $context->profile_stop("main");
+            $context->finish_profiler_log("D");
+        }
+    }
     $self->_disconnect();
 }
 

Reply via email to