]> git.vpit.fr Git - perl/modules/Test-Valgrind.git/blobdiff - lib/Test/Valgrind/Tool/memcheck.pm
Tools can only be run in one session at a time by default
[perl/modules/Test-Valgrind.git] / lib / Test / Valgrind / Tool / memcheck.pm
index 4f1c5a9f422f982f9d4471913acced0f04537e7f..15b65870c7231724e24afc7e57a253c6829e43f6 100644 (file)
@@ -121,9 +121,6 @@ sub _session { @_ <= 1 ? $_[0]->{_session} : ($_[0]->{_session} = $_[1]) }
 sub start {
  my ($self, $sess) = @_;
 
- $self->_croak('This memcheck tool can\'t be run in two sessions at once')
-                                                             if $self->_session;
-
  $self->SUPER::start($sess);
  $self->_session($sess);
 
@@ -323,13 +320,14 @@ sub handle_error {
                                      $origin->kid('stack')->children('frame') ];
  }
 
- my $report = Test::Valgrind::Tool::memcheck::Report->new(
+ my $tool = $twig->stash->{tool};
+ my $sess = $tool->_session;
+
+ $sess->report($tool->report_class($sess)->new(
   kind => $kind,
   id   => $id,
   data => $data,
- );
-
- $twig->stash->{tool}->_session->report($report);
+ ));
 
  $twig->purge;
 }