Skip to content

Commit

Permalink
bring back closeSigar() call in shutdown (commented out in cd42290)
Browse files Browse the repository at this point in the history
  • Loading branch information
dougm committed Apr 21, 2010
1 parent a5dacd4 commit b3078dc
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions bindings/java/src/org/hyperic/sigar/cmd/Shell.java
Expand Up @@ -199,9 +199,18 @@ public String getUserDeniedMessage(long pid) {

public void shutdown() {
this.sigar.close();
//avoid possible Class Not Found: junit/framework/TestCase
if (System.getProperty("jni.dmalloc") != null) {
//org.hyperic.sigar.test.SigarTestCase.closeSigar(); //shutup dmalloc
//cleanup for dmalloc
//using reflection incase junit.jar is not present
try {
//SigarTestCase.closeSigar();
Class.forName("org.hyperic.sigar.test.SigarTestCase").
getMethod("closeSigar", new Class[0]).invoke(null, new Object[0]);
} catch (ClassNotFoundException e) {
//SigarTestCase.java not compiled w/o junit.jar
} catch (Exception e) {
e.printStackTrace();
} catch (NoClassDefFoundError e) {
//avoiding possible Class Not Found: junit/framework/TestCase
}
super.shutdown();
}
Expand Down

0 comments on commit b3078dc

Please sign in to comment.