Category: Proxy usage
Are proxy types exception-safe?
Yes, they are. A proxy instance wraps around a Java object reference. When the proxy instance is destructed, the Java object reference is released. It does not matter whether the destruction takes place due to the object going out of scope normally or because an exception was thrown.
This is one of the advantages of using proxy types rather than JNI utilty types. The proxy types take advantage of the C++ object lifecycle management to make sure that no Java object references are being leaked.