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
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
9bddff59
Commit
9bddff59
authored
Aug 28, 2020
by
Xavier Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix reference-counting of underlying dict in cypclass dict views
parent
c17a6cba
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
7 deletions
+41
-7
Cython/Includes/libcythonplus/dict.pxd
Cython/Includes/libcythonplus/dict.pxd
+41
-7
No files found.
Cython/Includes/libcythonplus/dict.pxd
View file @
9bddff59
...
@@ -87,19 +87,53 @@ cdef extern from * nogil:
...
@@ -87,19 +87,53 @@ cdef extern from * nogil:
class view_dict
class view_dict
{
{
private:
private:
dict_t urange;
dict_t urange
= NULL
;
public:
public:
using iterator = iterator_t;
using iterator = iterator_t;
friend void swap(view_dict & first, view_dict & second)
{
using std::swap;
swap(first.urange, second.urange);
}
view_dict() = default;
view_dict() = default;
view_dict(view_dict const & rhs) = default;
view_dict(view_dict const & rhs) : urange(rhs.urange)
view_dict(view_dict && rhs) = default;
{
view_dict & operator=(view_dict const & rhs) = default;
if (urange != NULL)
view_dict & operator=(view_dict && rhs) = default;
{
~view_dict() = default;
urange->CyObject_INCREF();
}
}
view_dict(view_dict && rhs) : view_dict()
{
swap(*this, rhs);
}
view_dict(dict_t urange) : urange(urange) {}
view_dict & operator=(view_dict rhs)
{
swap(*this, rhs);
return *this;
}
~view_dict()
{
if (urange != NULL)
{
urange->CyObject_DECREF();
urange = NULL;
}
}
view_dict(dict_t urange) : urange(urange)
{
if (urange != NULL)
{
urange->CyObject_INCREF();
}
}
iterator begin() const
iterator begin() const
{
{
...
...
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