prevent reference cycles between Java and native objects

This commit is contained in:
Julian Winkler
2024-07-26 21:47:08 +02:00
parent 45801d8f17
commit e3c0931714
30 changed files with 257 additions and 181 deletions

View File

@@ -1596,6 +1596,18 @@ public final class Bitmap {
}
}
@Override
@SuppressWarnings("deprecation")
protected void finalize() throws Throwable {
try {
super.finalize();
} finally {
if (!isRecycled()) {
recycle();
}
}
}
/**
* internal ATL method to create or get a GdkTexture for the pixbuf
* @return pointer to the GdkTexture