Skip to content

Commit

Permalink
Use WeakMethod() to take a reference to a bound method.
Browse files Browse the repository at this point in the history
  • Loading branch information
sobomax committed Jul 29, 2024
1 parent 83c3a4e commit be6c9d7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sippy/b2bua_radius.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import sys
from functools import partial
from os.path import dirname, join as p_join
from weakref import ref as weakref_ref
from weakref import WeakMethod
sys.path.append(p_join(dirname(sys.argv[0]), '..'))

from sippy.Core.EventDispatcher import ED2
Expand Down Expand Up @@ -353,7 +353,7 @@ def placeOriginate(self, oroute):
if '_allowed_pts' in self.global_config:
prev_orc = self.uaO.on_remote_sdp_change
if prev_orc is not None:
prev_orc = weakref_ref(prev_orc)
prev_orc = WeakMethod(prev_orc)
self.uaO.on_remote_sdp_change = partial(self.filter_SDP, prev_orc=prev_orc)
self.uaO.kaInterval = self.global_config['keepalive_orig']
if 'group_timeout' in oroute.params:
Expand Down

0 comments on commit be6c9d7

Please sign in to comment.