[libinline-java-perl] 43/398: *** empty log message ***

Jonas Smedegaard dr at jones.dk
Thu Feb 26 11:42:43 UTC 2015


This is an automated email from the git hooks/post-receive script.

js pushed a commit to tag 0.55
in repository libinline-java-perl.

commit cba574d3a5948e4c30fb55295e1461fb6206b551
Author: patrick <>
Date:   Thu Mar 22 14:42:20 2001 +0000

    *** empty log message ***
---
 Java.pm          | 14 ++++++++------
 Java/Object.pm   | 20 +++++++++++---------
 Java/Protocol.pm |  2 +-
 3 files changed, 20 insertions(+), 16 deletions(-)

diff --git a/Java.pm b/Java.pm
index 5e92ab3..adc44af 100644
--- a/Java.pm
+++ b/Java.pm
@@ -36,7 +36,7 @@ use Inline::Java::Init ;
 # Stores a list of the Java interpreters running
 my @CHILDREN = () ;
 my $CHILD_CNT = 0 ;
-my $DONE = 0 ;
+$Inline::Java::DONE = 0 ;
 
 # Here is some code to figure out if we are running on command.com
 # shell under Windows.
@@ -58,7 +58,7 @@ my $COMMAND_COM =
 sub done {
 	my $signal = shift ;
 
-	$DONE = 1 ;
+	$Inline::Java::DONE = 1 ;
 
 	my $ec = 0 ;
 	if (! $signal){
@@ -72,9 +72,11 @@ sub done {
 	# Ask the children to die and close the sockets
 	foreach my $o (values %{$Inline::Java::INLINE}){
 		my $sock = $o->{Java}->{socket} ;
-		# this asks the Java server to stop and die.
-		print $sock "die\n" ;
-		close($o->{Java}->{socket}) ;
+		# This asks the Java server to stop and die.
+		if ($sock->connected()){
+			print $sock "die\n" ;
+		}
+		close($sock) ;
 	}
 
 	foreach my $pid (@CHILDREN){
@@ -91,7 +93,7 @@ sub done {
 
 
 END {
-	if (! $DONE){
+	if (! $Inline::Java::DONE){
 		done() ;
 	}
 }
diff --git a/Java/Object.pm b/Java/Object.pm
index b522410..82db239 100644
--- a/Java/Object.pm
+++ b/Java/Object.pm
@@ -99,15 +99,17 @@ sub AUTOLOAD {
 sub DESTROY {
 	my $this = shift ;
 
-	if (! $this->{private}->{deleted}){
-		$this->{private}->{deleted} = 1 ;
-		eval {
-			$this->{private}->{proto}->DeleteJavaObject() ;
-		} ;
-		croak "In method DESTROY of class $this->{private}->{class}: $@" if $@ ;
-	}
-	else{
-		Inline::Java::debug("Object destructor called more than once!") ;
+	if (! $Inline::Java::DONE){
+		if (! $this->{private}->{deleted}){
+			$this->{private}->{deleted} = 1 ;
+			eval {
+				$this->{private}->{proto}->DeleteJavaObject() ;
+			} ;
+			croak "In method DESTROY of class $this->{private}->{class}: $@" if $@ ;
+		}
+		else{
+			Inline::Java::debug("Object destructor called more than once!") ;
+		}
 	}
 }
 
diff --git a/Java/Protocol.pm b/Java/Protocol.pm
index d3584d8..237ac3b 100644
--- a/Java/Protocol.pm
+++ b/Java/Protocol.pm
@@ -254,7 +254,7 @@ class InlineJavaProtocol {
 			DeleteJavaObject(st) ;
 		}
 		else if (c.equals("die")){
-			ijs.debug(" received a request to die...") ;
+			ijs.debug("  received a request to die...") ;
 			System.exit(0) ;
 		}		
 	}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libinline-java-perl.git



More information about the Pkg-perl-cvs-commits mailing list