Merge "Added CloseGuard for BaseObj"

This commit is contained in:
Yang Ni
2016-03-31 22:56:37 +00:00
committed by Gerrit Code Review
11 changed files with 42 additions and 2 deletions

View File

@@ -41,6 +41,7 @@ public class Script extends BaseObj {
mScript = s;
mSlot = slot;
mSig = sig;
guard.open("destroy");
}
}
@@ -118,6 +119,7 @@ public class Script extends BaseObj {
super(id, rs);
mScript = s;
mSlot = slot;
guard.open("destroy");
}
}
@@ -358,6 +360,19 @@ public class Script extends BaseObj {
super(id, rs);
mInIdsBuffer = new long[1];
/* The constructors for the derived classes (including ScriptIntrinsic
* derived classes and ScriptC derived classes generated by Slang
* reflection) seem to be simple enough, so we just put the guard.open()
* call here, rather than in the end of the constructor for the derived
* class. This, of course, assumes the derived constructor would not
* throw any exception after calling this constructor.
*
* If new derived classes are added with more complicated constructors
* that throw exceptions, this call has to be (duplicated and) moved
* to the end of each derived class constructor.
*/
guard.open("destroy");
}
/**