Update of /cvsroot/freevo/kaa/base/src/notifier
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4834
Modified Files:
callback.py
Log Message:
Bug fixes to weakref destroy callback stuff.
Index: callback.py
===================================================================
RCS file: /cvsroot/freevo/kaa/base/src/notifier/callback.py,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** callback.py 14 Jul 2005 00:35:44 -0000 1.7
--- callback.py 14 Jul 2005 00:57:39 -0000 1.8
***************
*** 78,82 ****
cb = WeakCallback(data)
if destroy_cb:
! cb.set_weakref_destroy_cb(destroy_cb)
return cb
elif type(data) in (list, tuple):
--- 78,83 ----
cb = WeakCallback(data)
if destroy_cb:
! cb.set_weakref_destroyed_cb(destroy_cb)
! cb.set_ignore_caller_args()
return cb
elif type(data) in (list, tuple):
***************
*** 93,97 ****
return d
elif type(data) != types.FunctionType:
- print "DESTROY CB", data, destroy_cb
try:
if destroy_cb:
--- 94,97 ----
***************
*** 305,309 ****
def _weakref_destroyed(self, object):
if self and self._weakref_destroyed_user_cb:
! return self._weakref_destroyed_user_cb(self, object)
--- 305,309 ----
def _weakref_destroyed(self, object):
if self and self._weakref_destroyed_user_cb:
! return self._weakref_destroyed_user_cb(object)
***************
*** 360,370 ****
if weak:
callback = WeakCallback(callback)
- callback.set_weakref_destroyed_cb(self._weakref_destroyed)
! # We create a callback for weakref destruction for user data
! # as well.
! data_cb = Callback(self._weakref_destroyed, callback)
! data_cb.set_user_args_first()
! args, kwargs = weakref_data(args, data_cb), weakref_data(kwargs,
data_cb)
if pos == -1:
pos = len(self._callbacks)
--- 360,375 ----
if weak:
callback = WeakCallback(callback)
! # We create a callback for weakref destruction for both the
! # signal callback as well as signal data. The destroy callback
! # has the signal callback passed as the first parameter (because
! # set_user_args_first() is called), and WeakCallback will pass
! # the weakref object itself as the second parameter.
! destroy_cb = Callback(self._weakref_destroyed, callback)
! destroy_cb.set_user_args_first()
! callback.set_weakref_destroyed_cb(destroy_cb)
!
! args = weakref_data(args, destroy_cb)
! kwargs = weakref_data(kwargs, destroy_cb)
if pos == -1:
pos = len(self._callbacks)
-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP,
AMD, and NVIDIA. To register visit http://www.hp.com/go/dualwebinar
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog