Simplify allocation of JNI global classes and exceptions (#1110)

Helps ensure they get freed properly (We have had a few cases before where this wasn't the case).
This commit is contained in:
Thad House
2018-05-29 15:44:16 -07:00
committed by Peter Johnson
parent 39f80730de
commit 307da3ad2d
4 changed files with 104 additions and 142 deletions

View File

@@ -71,6 +71,11 @@ class JClass {
jclass m_cls = nullptr;
};
struct JClassInit {
const char* name;
JClass* cls;
};
template <typename T>
class JGlobal {
public:
@@ -618,6 +623,11 @@ class JException : public JClass {
jmethodID m_constructor = nullptr;
};
struct JExceptionInit {
const char* name;
JException* cls;
};
} // namespace java
} // namespace wpi