File tree Expand file tree Collapse file tree 1 file changed +9
-13
lines changed
Expand file tree Collapse file tree 1 file changed +9
-13
lines changed Original file line number Diff line number Diff line change @@ -92,31 +92,27 @@ cdef inline socket_dec_io_ref(sock):
9292
9393
9494cdef inline run_in_context(context, method):
95- # This method is internally used to workaround a reference issue that in
96- # certain circumstances, inlined context.run() will not hold a reference to
97- # the given method instance, which - if deallocated - will cause segfault.
98- # See also: edgedb/edgedb#2222
99- Py_INCREF(method)
95+ Context_Enter(context)
10096 try :
101- return context.run( method)
97+ return method( )
10298 finally :
103- Py_DECREF(method )
99+ Context_Exit(context )
104100
105101
106102cdef inline run_in_context1(context, method, arg):
107- Py_INCREF(method )
103+ Context_Enter(context )
108104 try :
109- return context.run( method, arg)
105+ return method( arg)
110106 finally :
111- Py_DECREF(method )
107+ Context_Exit(context )
112108
113109
114110cdef inline run_in_context2(context, method, arg1, arg2):
115- Py_INCREF(method )
111+ Context_Enter(context )
116112 try :
117- return context.run( method, arg1, arg2)
113+ return method( arg1, arg2)
118114 finally :
119- Py_DECREF(method )
115+ Context_Exit(context )
120116
121117
122118# Used for deprecation and removal of `loop.create_datagram_endpoint()`'s
You can’t perform that action at this time.
0 commit comments