Skip to content

Commit d4a68ac

Browse files
committed
Remove manual destroys
1 parent 5e9c023 commit d4a68ac

File tree

5 files changed

+0
-9
lines changed

5 files changed

+0
-9
lines changed

java_runtime/src/classes/java/io/byte_array_output_stream.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ impl ByteArrayOutputStream {
101101
.await?;
102102

103103
jvm.put_field(this, "buf", "[B", new_buf.clone()).await?;
104-
jvm.destroy(old_buf)?; // temporary before GC
105104
}
106105

107106
Ok(())

java_runtime/src/classes/java/io/input_stream.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ impl InputStream {
4747
let scratch = jvm.instantiate_array("B", n as _).await?;
4848
let _: i32 = jvm.invoke_virtual(&this, "read", "([BII)I", (scratch.clone(), 0, n as i32)).await?;
4949

50-
jvm.destroy(scratch)?;
51-
5250
Ok(n)
5351
}
5452
}

java_runtime/src/classes/java/lang/string_buffer.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,6 @@ impl StringBuffer {
194194
let mut java_new_value_array = jvm.instantiate_array("C", new_capacity).await?;
195195
jvm.put_field(this, "value", "[C", java_new_value_array.clone()).await?;
196196
jvm.store_array(&mut java_new_value_array, 0, old_values).await?;
197-
198-
// jvm.destroy(java_value_array)?; // We shouldn't destroy this, this might be referenced by other objects
199197
}
200198

201199
Ok(())

java_runtime/src/classes/java/net/url_class_loader.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,6 @@ impl URLClassLoader {
110110
)
111111
.await?;
112112

113-
jvm.destroy(bytes_java)?; // TODO: this should be done by the GC
114-
115113
Ok(class)
116114
}
117115

jvm/src/runtime/java_io_input_stream.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ impl JavaIoInputStream {
2525
jvm.array_raw_buffer(&java_buffer).await?.read(0, &mut buffer[buffer_offset..])?;
2626
}
2727

28-
jvm.destroy(java_buffer)?; // TODO: this should be done automatically
29-
3028
Ok(cast_vec(buffer))
3129
}
3230
}

0 commit comments

Comments
 (0)