more changes to avoid dmalloc reporting leaks
This commit is contained in:
parent
0dfdef864c
commit
94d3d82aab
|
@ -55,6 +55,7 @@ public abstract class SigarTestCase extends TestCase {
|
|||
public static void closeSigar() {
|
||||
if (sigar != null) {
|
||||
sigar.close();
|
||||
sigar = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@ package net.hyperic.sigar.test;
|
|||
|
||||
import net.hyperic.sigar.Sigar;
|
||||
import net.hyperic.sigar.SigarNotImplementedException;
|
||||
import net.hyperic.sigar.SigarProxy;
|
||||
import net.hyperic.sigar.Cpu;
|
||||
|
||||
public class TestCpu extends SigarTestCase {
|
||||
|
@ -29,8 +28,7 @@ public class TestCpu extends SigarTestCase {
|
|||
}
|
||||
|
||||
public void testCreate() throws Exception {
|
||||
SigarProxy sigar = Sigar.getInstance(); //test reuse
|
||||
|
||||
Sigar sigar = getSigar();
|
||||
Cpu cpu = sigar.getCpu();
|
||||
|
||||
traceln("getCpu:");
|
||||
|
|
|
@ -2,7 +2,7 @@ package net.hyperic.sigar.test;
|
|||
|
||||
import net.hyperic.sigar.SigarException;
|
||||
import net.hyperic.sigar.SigarProxy;
|
||||
import net.hyperic.sigar.SynchronizedSigarProxyCache;
|
||||
import net.hyperic.sigar.SigarProxyCache;
|
||||
import net.hyperic.sigar.SigarNotImplementedException;
|
||||
|
||||
import net.hyperic.sigar.ptql.ProcessQuery;
|
||||
|
@ -140,7 +140,8 @@ public class TestPTQL extends SigarTestCase {
|
|||
}
|
||||
|
||||
public void testCreate() throws Exception {
|
||||
SigarProxy proxy = SynchronizedSigarProxyCache.getInstance();
|
||||
SigarProxy proxy =
|
||||
SigarProxyCache.newInstance(getSigar());
|
||||
|
||||
testOK(proxy);
|
||||
testMalformed(proxy);
|
||||
|
|
Loading…
Reference in New Issue