mirror of
https://github.com/capstone-engine/capstone.git
synced 2025-02-18 21:41:42 +00:00
java: add close() method to avoid some unknown crash caused by finallize() on Ubuntu 14.04. FIXME
This commit is contained in:
parent
fadbddcbf8
commit
0ea529a6f3
@ -170,6 +170,9 @@ public class Test {
|
||||
all_insn[i].mnemonic, all_insn[i].opStr));
|
||||
}
|
||||
System.out.printf("0x%x:\n\n", all_insn[all_insn.length-1].address + all_insn[all_insn.length-1].size);
|
||||
|
||||
// Close when done
|
||||
cs.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -131,6 +131,9 @@ public class TestArm {
|
||||
System.out.println();
|
||||
}
|
||||
System.out.printf("0x%x:\n\n", (all_ins[all_ins.length-1].address + all_ins[all_ins.length-1].size));
|
||||
|
||||
// Close when done
|
||||
cs.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -117,6 +117,9 @@ public class TestArm64 {
|
||||
}
|
||||
|
||||
System.out.printf("0x%x: \n\n", all_ins[all_ins.length-1].address + all_ins[all_ins.length-1].size);
|
||||
|
||||
// Close when done
|
||||
cs.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -82,6 +82,9 @@ public class TestMips {
|
||||
}
|
||||
|
||||
System.out.printf("0x%x:\n\n", all_ins[all_ins.length-1].address + all_ins[all_ins.length-1].size);
|
||||
|
||||
// Close when done
|
||||
cs.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -87,6 +87,9 @@ public class TestPpc {
|
||||
System.out.println();
|
||||
}
|
||||
System.out.printf("0x%x:\n\n", (all_ins[all_ins.length-1].address + all_ins[all_ins.length-1].size));
|
||||
|
||||
// Close when done
|
||||
cs.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -88,6 +88,9 @@ public class TestSparc {
|
||||
System.out.println();
|
||||
}
|
||||
System.out.printf("0x%x:\n\n", (all_ins[all_ins.length-1].address + all_ins[all_ins.length-1].size));
|
||||
|
||||
// Close when done
|
||||
cs.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -87,6 +87,9 @@ public class TestSystemz {
|
||||
System.out.println();
|
||||
}
|
||||
System.out.printf("0x%x:\n\n", (all_ins[all_ins.length-1].address + all_ins[all_ins.length-1].size));
|
||||
|
||||
// Close when done
|
||||
cs.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -163,6 +163,9 @@ public class TestX86 {
|
||||
}
|
||||
|
||||
System.out.printf("0x%x:\n\n", all_ins[all_ins.length-1].address + all_ins[all_ins.length-1].size);
|
||||
|
||||
// Close when done
|
||||
cs.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -80,6 +80,9 @@ public class TestXcore {
|
||||
System.out.println();
|
||||
}
|
||||
System.out.printf("0x%x:\n\n", (all_ins[all_ins.length-1].address + all_ins[all_ins.length-1].size));
|
||||
|
||||
// Close when done
|
||||
cs.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -419,7 +419,13 @@ public class Capstone {
|
||||
|
||||
// destructor automatically caled at destroyed time.
|
||||
protected void finalize() {
|
||||
cs.cs_close(ns.handleRef);
|
||||
// FIXME: crashed on Ubuntu 14.04 64bit, OpenJDK java 1.6.0_33
|
||||
// cs.cs_close(ns.handleRef);
|
||||
}
|
||||
|
||||
// destructor automatically caled at destroyed time.
|
||||
public int close() {
|
||||
return cs.cs_close(ns.handleRef);
|
||||
}
|
||||
|
||||
// disassemble until either no more code, or encounter broken insn.
|
||||
|
Loading…
x
Reference in New Issue
Block a user