Port JNI class from Lime legacy

This commit is contained in:
Joshua Granick
2015-08-11 15:39:41 -07:00
parent f1b17dfb8d
commit dd8ca69353
11 changed files with 2523 additions and 62 deletions

View File

@@ -1,22 +0,0 @@
#ifndef LIME_UTILS_JNI_H
#define LIME_UTILS_JNI_H
namespace lime {
class JNI {
public:
static void *GetEnv ();
};
}
#endif

View File

@@ -8,10 +8,6 @@ namespace lime {
class Object {
public:
int ref_count;
protected:
virtual ~Object () {}
@@ -28,6 +24,25 @@ namespace lime {
}
Object *IncRef () {
ref_count++;
return this;
}
void DecRef () {
ref_count--;
if (ref_count <= 0) {
delete this;
}
}
void drop () {
ref_count--;
@@ -37,6 +52,8 @@ namespace lime {
}
}
int ref_count;
};