New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Since multidicts can be inherited they should call tp_free slot explicitly #407
Conversation
Codecov Report
@@ Coverage Diff @@
## master #407 +/- ##
=======================================
Coverage 75.15% 75.15%
=======================================
Files 5 5
Lines 471 471
=======================================
Hits 354 354
Misses 117 117 Continue to review full report at Codecov.
|
@@ -589,7 +589,7 @@ multidict_tp_dealloc(MultiDictObject *self) | |||
PyObject_ClearWeakRefs((PyObject *)self); | |||
}; | |||
pair_list_dealloc(&self->pairs); | |||
PyObject_GC_Del(self); | |||
Py_TYPE(self)->tp_free((PyObject *)self); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about adding macro #define MultiDictTpFree(ob) (Py_TYPE(ob)->tp_free((PyObject *)ob))
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This macro will be used at most twice: once for MultiDict/CIMultiDict and once for their proxies.
Do we really need the macro for such a case?
The expanded version is better readable from my perspective.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, you right.
No description provided.