more sigar.close for dmalloc
This commit is contained in:
parent
3a822b7d4f
commit
aa28742fdd
|
@ -20,7 +20,9 @@ import net.hyperic.sigar.shell.ShellCommandHandler;
|
|||
import net.hyperic.sigar.shell.ShellCommandInitException;
|
||||
import net.hyperic.sigar.shell.ShellCommandUsageException;
|
||||
|
||||
import net.hyperic.sigar.test.SigarTestCase;
|
||||
import net.hyperic.sigar.test.SigarTestRunner;
|
||||
|
||||
import net.hyperic.sigar.util.Getline;
|
||||
|
||||
/**
|
||||
|
@ -166,6 +168,7 @@ public class Shell extends ShellBase {
|
|||
|
||||
public void shutdown() {
|
||||
this.sigar.close();
|
||||
SigarTestCase.closeSigar(); //shutup dmalloc
|
||||
super.shutdown();
|
||||
}
|
||||
|
||||
|
|
|
@ -52,6 +52,12 @@ public abstract class SigarTestCase extends TestCase {
|
|||
return sigar;
|
||||
}
|
||||
|
||||
public static void closeSigar() {
|
||||
if (sigar != null) {
|
||||
sigar.close();
|
||||
}
|
||||
}
|
||||
|
||||
public Properties getProperties() {
|
||||
return this.props;
|
||||
}
|
||||
|
|
|
@ -56,6 +56,8 @@ public class TestInvoker extends SigarTestCase {
|
|||
SigarProxyCache.newInstance(sigar);
|
||||
|
||||
testOK(proxy);
|
||||
|
||||
sigar.close();
|
||||
}
|
||||
|
||||
private void testOK(SigarProxy proxy) throws Exception {
|
||||
|
|
|
@ -13,5 +13,6 @@ public class TestLog extends SigarTestCase {
|
|||
sigar.enableLogging(true);
|
||||
sigar.enableLogging(false);
|
||||
sigar.enableLogging(true);
|
||||
sigar.close();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,5 +32,7 @@ public class TestProcTime extends SigarTestCase {
|
|||
assertGtEqZeroTrace("Sys", procTime.getSys());
|
||||
|
||||
assertGtEqZeroTrace("Total", procTime.getTotal());
|
||||
|
||||
sigar.close();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ public class TestThreadCpu extends SigarTestCase {
|
|||
}
|
||||
|
||||
public void testCreate() throws Exception {
|
||||
Sigar sigar = new Sigar();
|
||||
Sigar sigar = getSigar();
|
||||
|
||||
ThreadCpu cpu;
|
||||
try {
|
||||
|
|
Loading…
Reference in New Issue