Merge "Added CloseGuard for BaseObj"
This commit is contained in:
@@ -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");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user