Port JNI class from Lime legacy
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user