mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-29 02:21:44 +00:00
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:
committed by
Peter Johnson
parent
39f80730de
commit
307da3ad2d
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user