Example #1
0
 public CallbackInfo(object callback, object weakRef) {
     this.callback = callback;
     // we need a short ref & a long ref to deal with the case
     // when what we're finalizing is cyclic trash.  (see test_weakref
     // test_callbacks_on_callback).  If the short ref is dead, but the
     // long ref still lives then it means we'the weakref is in the
     // finalization queue and we shouldn't run it's callback - we're
     // just unlucky and are getting ran first.
     this._longRef = new WeakHandle(weakRef, true);
     this._shortRef = new WeakHandle(weakRef, false);
 }
Example #2
0
 private weakcallableproxy(CodeContext context, object target, object callback) {
     WeakRefHelpers.InitializeWeakRef(this, target, callback);
     _target = new WeakHandle(target, false);
     _context = context;
 }
Example #3
0
 public @ref(object @object, object callback) {
     WeakRefHelpers.InitializeWeakRef(this, @object, callback);
     this._target = new WeakHandle(@object, false);
 }
Example #4
0
 private weakproxy(CodeContext/*!*/ context, object target, object callback) {
     WeakRefHelpers.InitializeWeakRef(PythonContext.GetContext(context), this, target, callback);
     _target = new WeakHandle(target, false);
     _context = context;
 }
Example #5
0
 public @ref(CodeContext context, object @object, object callback) {
     this._context = context;
     WeakRefHelpers.InitializeWeakRef(this._context.GetPythonContext(), this, @object, callback);
     this._target = new WeakHandle(@object, false);
 }