Skip to content

Commit

Permalink
ensure delegate class are working under gil
Browse files Browse the repository at this point in the history
  • Loading branch information
tito committed Oct 15, 2015
1 parent d40ed86 commit 0c5b3a0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pyobjus/pyobjus.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,7 @@ cdef get_python_delegate_from_id(id self):
return py_obj


cdef BOOL protocol_respondsToSelector(id self, SEL _cmd, SEL selector):
cdef BOOL protocol_respondsToSelector(id self, SEL _cmd, SEL selector) with gil:
# return True if a python delegate class responds to a specific selector
delegate = get_python_delegate_from_id(self)
if not delegate:
Expand All @@ -727,7 +727,7 @@ cdef BOOL protocol_respondsToSelector(id self, SEL _cmd, SEL selector):
return hasattr(delegate, py_method_name)


cdef id protocol_methodSignatureForSelector(id self, SEL _cmd, SEL selector):
cdef id protocol_methodSignatureForSelector(id self, SEL _cmd, SEL selector) with gil:
# returns a method signature for a specific selector, needed for the
# fallback forwardInvocation:
cdef ObjcClassInstance sig
Expand All @@ -754,7 +754,7 @@ cdef id protocol_methodSignatureForSelector(id self, SEL _cmd, SEL selector):
return sig.o_instance


cdef id protocol_forwardInvocation(id self, SEL _cmd, id invocation):
cdef id protocol_forwardInvocation(id self, SEL _cmd, id invocation) with gil:
# Implementation of dynamically added protocol instance method.
# This function dispatches the protocol method call to the corresponded
# Python method implementation. It also convert Objective C arguments to
Expand Down

0 comments on commit 0c5b3a0

Please sign in to comment.