Merge "Added CloseGuard for BaseObj" am: 64c4c1c

am: 157c73c

* commit '157c73cab3d24969c2b52a9ec2f9c6fb6cacb603':
  Added CloseGuard for BaseObj

Change-Id: Ic5d51599ef1939c2784f9cc2b693cc2370afb0a0
This commit is contained in:
Yang Ni
2016-03-31 23:09:02 +00:00
committed by android-build-merger
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");
}
}
@@ -357,6 +359,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");
}
/**