Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Gwenaël Samain
cython
Commits
a0ecad50
Commit
a0ecad50
authored
Apr 26, 2008
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix weakref issue for classes inheriting from a pxd
parent
911ca8a1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
Cython/Compiler/ModuleNode.py
Cython/Compiler/ModuleNode.py
+5
-3
No files found.
Cython/Compiler/ModuleNode.py
View file @
a0ecad50
...
...
@@ -686,13 +686,15 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
"static void %s(PyObject *o) {"
%
scope
.
mangle_internal
(
"tp_dealloc"
))
py_attrs
=
[]
weakref_slot
=
scope
.
lookup_here
(
"__weakref__"
)
for
entry
in
scope
.
var_entries
:
if
entry
.
type
.
is_pyobject
and
entry
.
name
!=
"__weakref__"
:
if
entry
.
type
.
is_pyobject
and
entry
is
not
weakref_slot
:
py_attrs
.
append
(
entry
)
if
py_attrs
or
scope
.
lookup_here
(
"__weakref__"
):
print
py_attrs
if
py_attrs
or
weakref_slot
in
scope
.
var_entries
:
self
.
generate_self_cast
(
scope
,
code
)
self
.
generate_usr_dealloc_call
(
scope
,
code
)
if
scope
.
lookup_here
(
"__weakref__"
)
:
if
weakref_slot
in
scope
.
var_entries
:
code
.
putln
(
"if (p->__weakref__) PyObject_ClearWeakRefs(o);"
)
for
entry
in
py_attrs
:
code
.
put_xdecref
(
"p->%s"
%
entry
.
cname
,
entry
.
type
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment