public void cleanup() { try { if (compositor != null) compositor.Native_destroy(); threadEnv.Destroy(); threadEnv.Native_destroy(); wrappedSource.Native_destroy(); familySource.Native_destroy(); if (rawSource != null) rawSource.Native_destroy(); } catch (KduException e) { System.err.printf("Exception on Kdu object cleanup: %s\n", e.getMessage()); } }